2

I'm doing some theme development, which I am somewhat new to. I am making changes to some files, and I like to test if they can compile correctly, so I run the setup:static-content:deploy somewhat regularly.

Prior to doing so, I purposely wipe the pub/static folder as well as var/page_cache & view_preprocessed folders respectively. The one thing that I do not know, if static-content is ever deployed into the generation/di folders ?

So if I'm doing compilation testing for .less file changes, do I need at all to wipe di & generation folder and re-run setup:di:compile ?

Just curious.

2 Answers 2

1

´generated' is used for generated code, like factories and interceptors. ´di´ is used to store information regarding dependency injection.

As such, those 2 folders don't affect rendering less files. ´view_preprocessed´ stores concatenated less files, so you well have to delete this one, and ´cache´ and ´page_cache´ affect rendered html, so you only need to flush those if the html is changed or you added a new stylesheet / JavaScript.

However, you're better of setting Magento to developer mode since this will create symbolic links in the ´pub´-folder, minimizing the need for deploying static content.

4
  • I'm actually running in developer mode, but I find testing with cache disabled is stupid slow. So I leave the cache enabled. I just clear it often. In this particular instance, I was attempting to add some css to a themeforest based theme, so I have to do a little poking around to find the correct file that was generating the styles-l.css file. Some of these themes are very poorly documented. Commented Nov 24, 2016 at 20:49
  • As such, I had to force recompilation to make sure I wasn't breaking the existing theme, and to make sure I was putting my changes into the correct file. I have found that the on-the-fly compilation doesn't always pick up changes (not sure why tbh). Commented Nov 24, 2016 at 20:51
  • @spyrule Create a child theme, make your purchased theme its parent, do css changes in there, using page source code as a guide. You should be able to read the source code since your not in production mode, per your commment on another post.
    – Jason
    Commented Oct 20, 2017 at 22:10
  • @Jason Thank you. Since I wrote this initial question, I have since understood and installed grunt. This takes a lot of the guess work out of this process. However, I do like the idea of making a child theme from the parent theme to build into. Commented Oct 21, 2017 at 3:58
0

From my understanding, those folders (DI and generation) do not contain any frontend assets. As such, I don't think it would be necessary.

0

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.