I've noticed that in developer mode whenever I enable an extension, or a theme, I will have to regenerate the static content. Here's an example of such a case.

According to the magento 2 documentation it shouldn't be required to regenerate static content in developer mode. Often times I have to force the regeneration.

Any ideas why the static content has to be regenerated?


I ask myself the same question. And the same with di:compile on developer mode. I spent hours thinking my code was broken, but it was just missing di:compile. Normally I work on production mode and I am used to run these commands after changes. But isn't the idea of developer mode to be faster for... development without having to wait for compile?

  • Yes! I have those exact same problems too. Like the official stripe extension. Docs say in production run di:compile and static-content:deploy ... but I still have to do that in development mode in order for it to work. Feb 21 '20 at 21:31
  • Usually, I don't need to deploy static content. I've found that removing frontend, adminhtml and _cache from pub/static to be sufficient. If deployed_version.txt exists, remove that as well.
    – Marisa
    Feb 21 '20 at 23:37
  • Yeah, you don't really have to run SCD (static content deploy) for visual stuff. But still gotta run di:compile and sometimes upgrade. If you run upgrade without --keep-generated, you might have to run SCD again. Go figure. :D Feb 23 '20 at 9:25

When you install or enable a new module, it might load new JavaScript, CSS, layouts, and so on. To avoid issues with static files, you must clean the old files to make sure you get all the changes for the new module.

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.

The term static view file refers to the following:

“Static” means it can be cached for a site (that is, the file is not dynamically generated). Examples include images and CSS generated from LESS.

“View” refers to presentation layer (from MVC).

By default, the static content deployment tool can be run only in production mode.

-f option is used to deploy files in any mode forcefully.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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