-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Css are embeded in the production build #10
Comments
This is expected - only CSS in the initial entry chunk is extracted. Any async-loaded chunks CSS is dynamically inserted. This is actually recommended because you don't want to load all the CSS in your async chunks on initial load. See http://webpack.github.io/docs/stylesheets.html#separate-css-bundle |
Consider the same example as vuejs/vue-loader#139 with vue-router and lazy-load to switch between ComponentA and ComponentB. Each component has its own chunk (0.js = ComponentA & 1.js = ComponentB) and each chunk contains the same CSS. Each chunk has its own piece of css, but each chunk is bigger. It would be best if the CSS was extracted in a file that is required along with the chunk. This way, if the CSS is already in cache, the new chunk use it. |
You can do that if you want to, just remove the |
Still the same with Each chunk contains the required CSS. Even if the CSS code is exactly the same. |
Oh I guess I misunderstood your last comment. See this section: http://webpack.github.io/docs/stylesheets.html#styles-in-commons-chunk |
👍 thank you sir ! |
Since the last few commits, the css are embeded in the JS files.
This happens only with the vue-router lazy-load method :
The text was updated successfully, but these errors were encountered: