Importing `.css.ts` files from other packages in a monorepo with Vite plugin
See original GitHub issueDescribe the bug
I’ve been testing out a vanilla-extract based component library (following patterns from Braid) along side a test site
in a monorepo.
When trying to build the component package from source within the site via Vite, the virtual files aren’t being resolved properly (getting a 404
)
I am not sure if this is an issue with either Vite, my setup/config, or the vanilla-extract plugin (possibly here at resolveId).
Link to reproduction
Examples repo 👉 @samrose3/pixels (yarn && yarn dev
)
Example codesandbox with slight vite.config.ts
modifications from above repo setup.
Just a note, I have been able to achieve a similar monorepo cross-package compile using the Webpack plugin. That seems to work well as expected. Only Vite has been giving me trouble.
System Info
Output of npx envinfo --system --npmPackages @vanilla-extract/css,@vanilla-extract/webpack-plugin,@vanilla-extract/esbuild-plugin,@vanilla-extract/vite-plugin,@vanilla-extract/sprinkles,webpack,esbuild,vite --binaries --browsers
:
System:
OS: macOS 11.5.2
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 1.92 GB / 32.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.17.0 - ~/.nvm/versions/node/v14.17.0/bin/node
Yarn: 1.22.10 - ~/.nvm/versions/node/v14.17.0/bin/yarn
npm: 6.14.13 - ~/.nvm/versions/node/v14.17.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Browsers:
Chrome: 92.0.4515.159
Chrome Canary: 95.0.4621.0
Firefox Nightly: 93.0a1
Safari: 14.1.2
npmPackages:
@vanilla-extract/vite-plugin: ^1.1.1 => 1.1.1
vite: ^2.4.4 => 2.4.4
webpack: ^5.50.0 => 5.50.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (2 by maintainers)
Top GitHub Comments
Hey 👋,
Sorry it took me a bit to have a look at this. I think there’s a few different issues being raised here so it would be good to separate them out into separate issues. However, the initially raised issues here seems to be fixed by upgrading to the latest
@vanilla-extract/vite-plugin
andvite
packages.@samrose3 awesome. Going to close this issue. Feel free to make another one with the repro for the other problem.