Skip to content

Deploying static files

For performance, Magento 2 now generates static files from your theme and other site components.  This feature is well documented at the Magento 2 dev docs, but there are some tricks to deploying and generating these files on MageMojo server.

Before deploying static files, you should remove any files in pub/static (but not the .htaccess file there!)

You should also clear the following, which will affect compilation, so you may want to do a full production mode deploy, instead.

  1. Delete all folders under pub/static
  2. Delete var/cache
  3. Delete var/composer_home
  4. Delete var/generation
  5. Delete var/page_cache
  6. Delete var/view_preprocessed
  7. Delete var/di (if it is present)

Then static files can be deployed using the following command (run from the bin directory in your Magento install).

php bin/magento setup:static-content:deploy