Question

After a year or so of working in Developer Mode, I'm now using Production Mode.

As I deploy updates to modules or designs, I'm wondering when I should run the below commands. At the moment, my order of operations is:

  1. Update files in app/code or app/design
  2. Run bin/magento setup:di:compile
  3. Run bin/magento setup:static-content:deploy en_GB

Is this still necessary when updating something like a stylesheet or template?

Was it helpful?

Solution

php bin/magento setup:upgrade :

Upgrades the Magento application, DB data, and schema

php bin/magento setup:di:compile :

Generates DI configuration and all missing classes that can be auto-generated

php bin/magento setup:static-content:deploy :

Deploys static view files

CSS where is it placed ? in view files : app/design/frontend/{Theme}/{name}/web/css/custom.css or app/code/Vendor/Name/view/frontend/web/css/custom.css So YES you need to deploy the static-contents on production mode.

Magento DevDocs says :

The static view files deployment command enables you to write static files to the Magento file system when the Magento software is set for production mode.

Good luck

OTHER TIPS

The brief answer is yes for stylesheet/templates you would then need to redeploy the static content. You wouldn't need to compile.

Compilation would be required for something like, for example, adding a new extension or adding a new instance of a model into an existing module.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top