-
Notifications
You must be signed in to change notification settings - Fork 296
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
✨ add option to inline/load css to style element for esbuild plugin #1150
base: master
Are you sure you want to change the base?
✨ add option to inline/load css to style element for esbuild plugin #1150
Conversation
|
I'm not sure this should be an option of VE, it's a very specific use case. Isn't it possible to configure esbuild (maybe with a plugin) so that it transforms the css loader result into this kind of style loader? |
@graup I tried to get it working as a separate plugin but it didn't work, I either have to create the VE plugin again or add the support to the existing one, I think it could be because VE css files are virtual and they got intercepted first by vanilla-extract and handed to the css loader directly which I can't intercept |
Can you release a version. thk |
@yaojiu19 I'm not sure if this PR is ready to test, or is even something we want to still pursue. @salamaashoush Any updates? |
I can rebase and update the MR if you want to test and merge it, currently i copied the plugin into my project repository and using it |
yeah, manually import css files is inconvenient in monorepo‘s project |
In some environments and use cases (eg Figma plugins) you can't load external resources with relative paths so you either have to host CSS separately on a remote server or inline it in the JS/HTML so this PR adds a new option
useStyleLoader
to@vanilla-extract/esbuild-plugin
that allows you to skip CSS loader and inject the CSS using style element in the current document, by emitting a JS file with the code to do that similar to (style-loader)