✨ add option to inline/load css to style element for esbuild plugin#1150
✨ add option to inline/load css to style element for esbuild plugin#1150salamaashoush wants to merge 1 commit intovanilla-extract-css:masterfrom
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
useStyleLoaderto@vanilla-extract/esbuild-pluginthat 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)