3

This question already has an answer here:

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!

marked as duplicate by Fabian Schmengler, Raphael at Digital Pianism, Amit Bera, brentwpeterson, Qaisar Satti Oct 3 '16 at 5:34

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 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. – Rakesh Jesadiya Sep 28 '16 at 8:41
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 '16 at 8:15
  • @TejabhagavanKollepara have you remove var folder and run deploy command, also remove browser cache to see affect – Rakesh Jesadiya Sep 28 '16 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 – Rakesh Jesadiya Sep 28 '16 at 8:42
-1

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? – Rakesh Jesadiya Sep 28 '16 at 7:43
  • @Rakesh if you're in production mode yes: devdocs.magento.com/guides/v2.1/config-guide/cli/… – Raphael at Digital Pianism Sep 28 '16 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 – Rakesh Jesadiya Sep 28 '16 at 7:48
  • @Rakesh you're probably not in developer mode then. Or you have permissions issues – Raphael at Digital Pianism Sep 28 '16 at 7:49
  • @RaphaelatDigitalPianism what does "Static file Materialization" mean? Sorry if this is a stupid question. – Ethan Wan Sep 28 '16 at 8:27

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