How to use Vanilla Extract as part of a react component UI library #1173
-
Hello, We are currently building a UI library for use in our react/ts applications and are experimenting with using Vanilla Extract. We find that the components work well with our test environment, however when we publish the library (built with tsc) we find that we get this error:
We believe this is due to our tsc build compiling vanilla css.ts files down to css.js file types instead of css.ts. Are there any recommended solutions for utilizing Vanilla Extract in libraries such as this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
So, you export the result of running If you want ship the library code in a more ”plug-and-play” manner I think it’s possible to use Rollup for this, but I have not tried this myself. I believe for example that it comes with a few tradeoffs that it might be good to consider before diving in. We’ve used the ”compile and ship component lib with |
Beta Was this translation helpful? Give feedback.
Adding the @vanilla-extract/webpack-plugin to our consumer application resolved the issue. Thanks for the helpful response!