-
Is there a way to create a component library with vanilla extract bundling CSS and not JS files? BackgroundI'd like to create a TS React component library with vanilla extract where the consuming apps does not depend on vanilla extract's build time plugins, so it works with more build environments. I tried using various integrations so far (esbuild, vite with library mode) but I'm most successful with the rollup plugin. I'd like to use Recipes and produce a single bundled CSS file and unbundled JS files. But I noticed with the rollup plugin and preserving modules, the produced JS files eventually import CSS files produced by the .css.ts files. Importing CSS files only works with build environments with css loaders. So it seems like a good idea not to produce .js files importing css files, albeit losing the ability to do CSS code splitting. On the other hand, I'd like to preserve source modules for code splitting. I took a look at: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
OK. I wrote some code myself in my rollup config: https://github.com/danvim/vanilla-extract-rollup-example |
Beta Was this translation helpful? Give feedback.
OK. I wrote some code myself in my rollup config: https://github.com/danvim/vanilla-extract-rollup-example