-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Some problems with cssCodeSplit and Library Mode #8057
Comments
Did you find a solution to this? I'd like to find a way to export my original modules alongside the concatenated style sheet. |
Instead of using
I recently wrote a blog post including this topic: https://dev.to/receter/how-to-create-a-react-component-library-using-vites-library-mode-4lma @emosheeep Your plugin works great for me, first I tried using |
@receter I just read your blog, and I got you. Did you mean what need to be added to the docs is that you quoted above from Rollup's docs? I think it's ok, may be it can be added to "QA" or "Recipes of creating component library" section, and titled it properly. I’ll be appreciated it if you have time to work for this, because I'm just exhausted with my current job which is working my last nerve. |
That's great. You inspired me, We can create a plugin that focuses on the lib mode, and it can follow |
@receter Its work just perfect! Thanks a lot. |
You could build .cjs in a separate build step. |
Clear and concise description of the problem
I enabled preserveModules and cssCodeSplit in library mode.
But css files don't follow the preserveModules rule, use the original module name as the file name.
related code:
vite/packages/vite/src/node/plugins/css.ts
Lines 461 to 464 in 1ffc010
Suggested solution
I want to use the original module name as the file name as required by preserveModules when cssCodeSplit is enabled.
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: