luangjokaj/wordpressify

main.js dont load

AndreVictor opened this issue · 3 comments

I have a very simple code in main.js that is bundled in footer-bundle.js, howaver, it dont load in page in dev mode. I tried to clean cache of browser once and it work, but I think that I should not must to do this every time a write a line of code in main.js. And, bisede all of this, other times that I tried to clean cache didnt work any more. Its some thing with gulpfile.js?

ps.: Isn't clear that const themeName need to be the folder name. Is it right? I wast putting the display name, than when a take a look in gulpfile I realized that make more sense the folder name.

So, if I understood correctly, the problem is that when you make changes to main.js, those changes only appear after you clean the cache.

That's actually to be expected, browsers cache assets. If you're using Google Chrome, this can be worked around by opening dev tools, going to the network tab, and then checking "Disable cache". I'm sure there are similar solutions for other browsers.

There's no way to fix this on the WordPressify side yet. However WordPressify might transition to using webpack soon, and webpack can have cache busting so that will help.

hmmm thats works! This until looks like live reload with cache busting. Thank you!

ps.: when I has change the const themeName gulp has created a new folder to the theme and I didnt saw.

Glad it works.

Please close this issue in that case, I don't have write permissions in this repository so I can't do it myself.