-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Request: support "indexed" source maps #3439
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
Comments
I have done a lot of work with source map infrastructure over the years and I've only ever encountered one indexed source map (by chance, on a random website). So I don't actually really have any test cases to go by. It'd be helpful for you to provide a way to reproduce your issue here (i.e. providing specific code with specific build instructions). |
Yup yup sure thing 👍 Here's a minimal example of my specific use case of compiling from ClojureScript to JavaScript: https://github.com/seanstrom/cljs-dev-template/tree/minimal-sourcemaps-debug-esbuild I've included some instructions inside the README of that branch, should be as simple as setting the local environment to have some dependencies like Java, Clojure, and Node. And then running some NPM scripts for compiling the source code and bundling the outputs with esbuild. If you need specific version numbers for the environment dependencies, you can reference the If you need any help with setting up the project, please let me know 🙏 |
They're definitely rare. Turbopack is the only build tool I know of that generates them purposefully (it interacts with our caching infrastructure gracefully), but we're not currently used in any npm libraries that esbuild would then have to consume. Maybe in the future they'll be more popular. |
@evanw have you looked over the build steps and and code the I've linked? I'm wondering, is there anything else I can do to help add this functionality? At the moment, I've also noticed that Vite is missing support for "indexed" source maps, though I have been able to patch Vite by re-using the logic that Webpack's source-map-loader uses to "flatten" these sections into a source map. Curious to get your thoughts on the flattening process since that seems to compose a single source map from all the sections, but I'm not sure how that's exactly done. |
For my own benefit, here's a more minimal reproduction created from that repo (note that I don't know anything about Clojure myself): |
Nice stuff! Moving forward I'll try adapting my experiments into these esbuild playgrounds. And please lmk if you'd like me to test any esbuild changes, or if you'd like some help figuring out these source-map specs for sections support. |
Hello 👋
I have a request for functionality related to how esbuild supports source maps at the moment. And in this case I would to request some additional support for source maps with the
sections
field, a.k.a "indexed" source mapsThe reason for this request is because I'm using some tooling that compiles to JavaScript and provides a source map with this indexed source map format. And at the moment, these source maps are not supported by esbuild:
esbuild/internal/js_parser/sourcemap_parser.go
Lines 38 to 41 in 02dae18
But I'm hoping that it would be possible to "flatten" these indexed source maps in a way that is similar to Webpack's approach seen here. What are your thoughts? Let me know what you think 🙏
The text was updated successfully, but these errors were encountered: