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

Relative Url Rewriting #19

Closed
GravlLift opened this issue Jul 28, 2021 · 1 comment
Closed

Relative Url Rewriting #19

GravlLift opened this issue Jul 28, 2021 · 1 comment

Comments

@GravlLift
Copy link
Contributor

Sass doesn't like relative urls in non-entry files. Webpack gets around this shortcoming with the resolve-url-loader plugin, which uses sourcemaps generated by Sass to rewrite the urls after the compilation has completed.

Esbuild doesn't yet output sourcemaps into the build output proper, but this plugin could still have access to them by adding a sourcemap option to the sass call and then saving the map property that's returned. With those maps in memory, similar relative url rewriting could be achieved.

@glromeo
Copy link
Owner

glromeo commented Jul 29, 2021

Sorry @GravlLift but what you ask for is a feature I don't intend to implement.
If there's an issue for a developer that is conceptually not in esbuild+sass but rather in sass itself.
I understand that having a single sass entry file can be more efficient or if you prefer more in line with the mindset of a web designer but it's not within the scope of this plugin.
For the workflows I am keen to support modularising/scoping the sass code is better done by using javascript imports (with one sass entry-file per component) and by limiting the usage of sass imports to shared styles & macros.

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