Pub/static in Magento 2

pub/static/: this contains the .css, .js and .html files that have been
processed and are ready for the end-user to download. If a path is requested
but doesn’t exist as a file in this folder, Magento tries to create it when not
in production mode (or if you add a store with a new language). If your
website is in developer mode, and you run bin/ magento dev:sourcetheme:
deploy, most files in this directory will be symlinked to their
sources throughout the Magento codebase. In production mode, you run
bin/ magento setup:static-content:deploy to process and copy files to
this directory.
What’s the difference? dev:source-theme:deploy creates symlinks
from module’s LESS files into the pub/static directory. This allows
LESS files changes, in modules, to always be of the latest version.
setup:static-content:deploy copies all necessary files (JS, HTML and
LESS compiled to CSS) to the pub/static directory. Once this command
is run, changes to your LESS and JS files in your module will not be

admin

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top