nystudio107 / annotated-webpack-config

This is the companion github repo for the "An Annotated webpack 4 Config for Frontend Web Development" article.
https://nystudio107.com/blog/an-annotated-webpack-4-config-for-frontend-web-development
MIT License
435 stars 75 forks source link

Workbox precache-manifest does not pick up stylesheets #13

Open ClemensSchneider opened 5 years ago

ClemensSchneider commented 5 years ago

When building the project, the generated precache-manifest does only include javascript files but no stylesheets. This is due to the fact, that the workbox plugin is only included in the modern-build but stylesheets are only generated once for the legacy-build and thus are not available as assets in the modern-build.

Maybe it would be better to move stylesheets to the modern-build part so that they are visible to the "more relevant" modern-build parts?

khalwat commented 5 years ago

So the logic here was that we don't want the SW to be running as part of the legacy build, because then it'll be pre-caching our old ES2015 JS... which is unlikely to be what we want if a SW is running.

So then perhaps we look into moving the CSS build into the modern build phase instead?