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

Allow custom source-map location #2254

Closed
icedtoast opened this issue May 16, 2022 · 2 comments
Closed

Allow custom source-map location #2254

icedtoast opened this issue May 16, 2022 · 2 comments

Comments

@icedtoast
Copy link

Can an option(s) be added to:
a) Place sourcemaps in a separate folder in the output directory? (e.g. output/dist.js , output/sourcemaps/dist.js.map )
b) Customize the url used to refer to sourcemaps? So that they can be served from an internal-only host.

@evanw
Copy link
Owner

evanw commented Dec 3, 2022

I believe this should already be straightforward to do. Use write: false to return an array of output files along with sourcemap: 'external' so sourceMappingURL comments are not already added. Then write some code to place the .map files wherever you want and to append sourceMappingURL comments to the corresponding source files with the correct location. This approach is not that much code and should already more flexible than providing an option within esbuild itself, so I'm not currently planning on adding this to esbuild's official API.

@evanw evanw closed this as not planned Won't fix, can't repro, duplicate, stale Dec 3, 2022
@EloB
Copy link

EloB commented Feb 21, 2024

Is there a simple way to only output the same name as the file itself? I have multiple entrypoints and using entryNames with object (in/out).

image

Current behaviour

//# sourceMappingURL=/EndpointGet/app.mjs.map

Wanted behaviour

//# sourceMappingURL=app.mjs.map

AFAIK the only way to archive this is either with plugins or footer but that works bad with splitting.

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

3 participants