Skip to content
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

Disable resolving url() in stylesheets? #3801

Open
splashsky opened this issue Jun 13, 2024 · 3 comments
Open

Disable resolving url() in stylesheets? #3801

splashsky opened this issue Jun 13, 2024 · 3 comments

Comments

@splashsky
Copy link

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
Copy link
Owner

evanw commented Jun 13, 2024

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

@splashsky
Copy link
Author

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
Copy link
Owner

evanw commented Jun 14, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants