1

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?

2 Answers 2

3

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

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.