Some threads say compilation is not necessary in developer mode, what about static-content:deploy? When I working on magento 2 modules, I often have problems getting my changes updated in the front end, I sort of leaned to clear different types of cache, generated files and static files, but I'm not sure whether deploy static content is necessary in developer mode. Any comments would be appreciated, thanks!

  • First remove pub/static content and you need to run deploy command otherwise your changes are not apperar and all files inside pub/static are not updated. Sep 28, 2016 at 8:41

2 Answers 2


Yes, Run deploy command is necessary for developer mode for below cases.

When you install any new extension you need to define deployment command when module contains any custom web/js folder and web/template static file if you cant run deploy command you have to see many js error inside console.

When you need to customized on module web js folder content at that time you need to run deploy command to get effect of changes in frontend.

In most cases, when you customize module/view/{area}/web/js/ and module/view/{area}/web/template/ file at that time you must need to run deploy command to see changes on your area. Here area is frontend or admin.

  • Thanks for your insight, that's really helpful because a lot of times when I clear all cache even static content updates are still not appearing in the front end. I haven't done any js customisation, mainly layout and template and I do notice in most cases clear cache and var/generation do the trick, while other times they drive me nuts. Magento 2 has a very stiff learning curve.
    – Ethan Wan
    Sep 28, 2016 at 8:15
  • @TejabhagavanKollepara have you remove var folder and run deploy command, also remove browser cache to see affect Sep 28, 2016 at 8:37
  • @TejabhagavanKollepara, go to cmd and go your project root, now run command php bin/magento setup:static-content:deploy, Before run deploy command you need to remove pub/static and root var folder Sep 28, 2016 at 8:42

No, in developer mode, static file materialization is not enabled. Thus, static view files are generated every time they are requested. They are written to the pub/static directory, but this cache is not used. This has big performance impact, but any changes a developer makes to view files are immediately visible. I reckon the problems you're facing are more related to the interceptors, where var/generation needs to be flushed when changing classes constructors.

Btw, you can learn more about the different modes here: https://magento.stackexchange.com/a/111708/2380

  • Hi, when any web/js or web/template static file need to customize at that time we need to run deploy command to see chagnes, Right? Sep 28, 2016 at 7:43
  • @Rakesh if you're in production mode yes: devdocs.magento.com/guides/v2.1/config-guide/cli/… Sep 28, 2016 at 7:47
  • but when we changes on web/js folder its not get changes directly when we refrresh front, after run deploy its take effect on front in developer mode also Sep 28, 2016 at 7:48
  • @Rakesh you're probably not in developer mode then. Or you have permissions issues Sep 28, 2016 at 7:49
  • @RaphaelatDigitalPianism what does "Static file Materialization" mean? Sorry if this is a stupid question.
    – Ethan Wan
    Sep 28, 2016 at 8:27

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