Replies: 1 comment
-
|
I am also curious about this. There must be a reason, but I can't find any documentation for it. |
Beta Was this translation helpful? Give feedback.
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.
-
Are there any negative performance impacts or anything else to be aware of when enabling
build.cssCodeSplit: trueonvite.config?The Vite docs indicate that
cssCodeSplitdefaults tofalsewhen utilizing Vite'slibbuild option. In my organization, I maintain a component library as part of our broader design system. We have teams consuming our library that don't want to import all of the styles for the entire library, i.e. importing@my-package/css/dist/style.min.cssonmain.js, because they only use a handful of the available components.We've tested enabling
build.cssCodeSplit: true, and this config seems to work for us -- a team consuming our library can install our npm package, import a component for use on some SFC, and the component's styles are included without having to import a@my-package/css/dist/style.min.cssstylesheet onmain.js.However, my suspicion is that
cssCodeSplitdefaults tofalsewhen building a library for a good reason. I'm wondering, what might that reason be?We maintain a Vue.js library, and utilize Vite's Library Mode.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions