Replies: 3 comments 3 replies
|
Without patching, I get my standard CSS inlined, but CSS modules are not being inlined. Not sure if this is the expected behavior! |
0 replies
|
Why do you want it inlined? Loading the CSS and JS in parallel is more efficient (and has better caching behavior). |
3 replies
|
I'm in the same boat. Would be great for lib mode if there was an option for inlining CSS. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Cross-posting a Discord message.
Hey! and thanks for Vite.
I wonder — what if I want to inline all CSS (including css modules?)
It can be patched by skipping this if (setting format to be something other than es):
vite/packages/vite/src/node/plugins/css.ts
Line 321 in ab8a55e
but maybe this should be configurable? maybe something like:
{ "build": { "inlineAllCss": true } }so the attached code could be:
I currently patched it on my project to be
false && opts.format === 'es'for the sake of making it work, but is it something the maintainers would want to have? maybe a different direction to that?I mean, why does the output format controls how and whether CSS is being injected? Sounds like it's a derivative of the format, if no other configuration was provided 😃
Thanks again
All reactions