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

Feature Request: Minify Nested SourceMaps when one or more Plugins are used to change the input. #3844

Open
mitcoding opened this issue Jul 24, 2024 · 2 comments

Comments

@mitcoding
Copy link

while trouble shooting css sourcemap issue reported here, I found that esbuild doesn't merge nested SourceMaps. I think it would be a good idea for esbuild to handle this natively instead of having to use a javascript lib like sorcery as esbuild can handle doing that in memory while that lib currently only supports writing to the fs first. On top of that it should help with performance when plugins are required to do additional transpiling that esbuild has no plans of sporting natively like SASS.

@evanw
Copy link
Owner

evanw commented Jul 25, 2024

That's strange because esbuild does merge nested source maps, and has for many years (since version 0.6.5). Here is an example. As you can see from the source map visualization, the final source map maps all the way back to the original code (respecting the nested source map) instead of the intermediate code (ignoring the nested source map).

I'm marking this issue as unactionable because it lacks any reproduction instructions, so there's nothing I can do with it.

@mitcoding
Copy link
Author

I just uploaded the bundle files that cause the issue. with that said the specific merge I'm asking for that sorcery does that esbuild doesn't do, which you can see by removing sorcery step in the example repository is that sorcery minifies the nested source maps. as I had stated in the origional issue opened with esbuild-sass-plugin without sorcery the final map file is twice as large because it includes source code for origional files and the initial bundled sass version generated by sass-embeded.

https://github.com/mitcoding/esbuild-sass-source-map-issue

@mitcoding mitcoding changed the title Feature Request: Merge Nested SourceMaps when Plugins are used Feature Request: Minify Nested SourceMaps when Plugins are used to apply multiple transformations Jul 25, 2024
@mitcoding mitcoding changed the title Feature Request: Minify Nested SourceMaps when Plugins are used to apply multiple transformations Feature Request: Minify Nested SourceMaps when one or more Plugins are used to change the input. Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants