-
Notifications
You must be signed in to change notification settings - Fork 40
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
Inlining css with type="style" option skips processing url(...) #92
Comments
I have a repro here: https://github.com/cnshenj/azdo-ext. Just comment out the |
got it working finally, it's a matter of specifying correctly 'base' and 'to' properties to get proper paths in the output.
|
Is there a way to still pass |
@cnshenj unfortunately not, the only way to have @linasburneika thank you so much for getting to the bottom of your issue... I improved the README hoping that it will help other people in the future |
Want to share one more example. The example below works fine for me: import { postcssModules, sassPlugin } from 'esbuild-sass-plugin';
import postcssUrl from 'postcss-url';
...
sassPlugin({
type: 'style',
transform: postcssModules(
{ /* some options */ },
[ postcssUrl({ url: 'inline' }) ]
)
}) |
If you use this plugin with type="css" option then the default 'css' loader of esbuild is used to process rendered css text, which in turn can use other loaders to handle fonts or images defined in url(...)
In case type is "style" then the rendered css text is embeded into the bundle without any further processing. It doesn't give any build errors, but at runtime you may see missing images and fonts.
I tried several postcss plugins to extract css assets, but no luck so far. Any ideas?
The text was updated successfully, but these errors were encountered: