Skip to content
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

Vue SSR render initial css chunks correctly #7897

Closed
clarkdo opened this issue Mar 27, 2018 · 0 comments · Fixed by #7902
Closed

Vue SSR render initial css chunks correctly #7897

clarkdo opened this issue Mar 27, 2018 · 0 comments · Fixed by #7902

Comments

@clarkdo
Copy link
Contributor

clarkdo commented Mar 27, 2018

What problem does this feature solve?

Now webpack4 mini-css-extract-plugin supports css async-loading and splitted chunks, it also has been supported in vue-loader-15

But when we use it in ssr, it will still get all css files at ssr rendering.

Through my investigation, current vue-ssr webpack plugin will not generate corresponding css into initial and async inside vue-ssr-client-manifest.json.
https://github.com/vuejs/vue/blob/dev/src/server/webpack-plugin/client.js#L19-L26

And also renderer renderStyles will render all css which includes splitted async css chunks.
https://github.com/vuejs/vue/blob/dev/src/server/template-renderer/index.js#L112

What does the proposed API look like?

css - initial chunks are in initial
css - spiltted chunks are in async
context.renderStyles() return all initial chunks
mini-css-extract-plugin will auto load async chunks

yyx990803 pushed a commit that referenced this issue Apr 7, 2018
compatibility with webpack 4 + mini CSS extraction

close #7897
f2009 pushed a commit to f2009/vue that referenced this issue Jan 25, 2019
compatibility with webpack 4 + mini CSS extraction

close vuejs#7897
aJean pushed a commit to aJean/vue that referenced this issue Aug 19, 2020
compatibility with webpack 4 + mini CSS extraction

close vuejs#7897
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants