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! |
Beta Was this translation helpful? Give feedback.
-
Why do you want it inlined? Loading the CSS and JS in parallel is more efficient (and has better caching behavior). |
Beta Was this translation helpful? Give feedback.
-
I'm in the same boat. Would be great for lib mode if there was an option for inlining CSS. |
Beta Was this translation helpful? Give feedback.
-
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:
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
Beta Was this translation helpful? Give feedback.
All reactions