evanw / esbuild

An extremely fast bundler for the web
https://esbuild.github.io/
MIT License
37.58k stars 1.11k forks source link

Disable resolving url() in stylesheets? #3801

Open splashsky opened 2 weeks ago

splashsky commented 2 weeks ago

My stylesheets have plenty of references to images through relative paths (url()), and when I try to bundle my CSS (which I would assume just imports all the CSS into one build) esbuild fails saying it can't resolve the url() calls. Can I have the bundler ignore these and let me determine where the files are?

evanw commented 2 weeks ago

You should be able to do that with a plugin: https://esbuild.github.io/plugins/#on-resolve

splashsky commented 2 weeks ago

Is there no way to do this binary-only? My project is non-traditional and so I'm avoiding the use of any node_modules or packages; in fact, the only JavaScript are downloaded, minified scripts not delivered by CDN or managed by a package manager.

evanw commented 2 weeks ago

No, sorry. Plugins are the intended way to alter path resolution in esbuild if you have custom requirements like this.