pugjs / pug-loader

Pug loader module for Webpack
MIT License
425 stars 119 forks source link

Includes and or mixins sometimes do not trigger changes in parents while watching #131

Open spence-s opened 3 years ago

spence-s commented 3 years ago

There are some weird issues with includes that have been addressed in other open issues. But I wanted to document another issue that has been a pain point for me, in that I think the includes are treated as orphaned modules, and when a change in an included template occurs, the cache is not correctly invalidated and webpack watch will only rebuild the module and not the containing chunk. - could be wrong about the specifics of what's going on here, but it requires stopping webpack watch and rebuilding the the bundles from scratch to get the changes from child includes to propagate into the parent chunks.

I don't think this is all scenarios, but definitely some. Also, I want to start using new persistent cache features and this makes me weary that those file changes won't bust the cache properly - although I haven't tested against this.

spence-s commented 3 years ago

I published a package that fixes these problems for me as well as some of the other issues with this loader and predictable variable scoping with includes and mixins.

https://www.npmjs.com/package/simple-pug-loader