-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
null
in sourcesContent
is still null
in the output even if --sources-content=true
#3144
Comments
Can you say why the I'm asking because a Having esbuild try to do something else here could cause esbuild to do something that's not correct. So what esbuild is doing here doesn't initially seem like a problem with esbuild to me. |
Thanks for the response.
It's That being said, I think it's a valid choice to publish a package with having
In this case, what should the user that wants to use this package do? As far as I know the source map spec only says "“null” may be used if some original sources should be retrieved by name.". FWIW webpack/ The original issue is vitejs/vite#13391. In Vite we're relying on the sourcesContent field in a special way, so the original issue itself isn't much important for esbuild. I reported this issue without including that context because I thought it will make the description complicated and I thought this would also be an issue when directly using esbuild as a bundler for a website. |
Thanks for the reference to the specification. I agree that the specification sounds like esbuild should be trying to find the original source file in this case, so I will add this to esbuild. |
Thanks! |
When the input file has a sourcemap has
null
insourcesContent
, the output sourcemap will includenull
insourcesContent
. This happens even if--sources-content=true
is set.Reproduction
Reproduction with esbuild.github.io/try
entry.js
: importsfoo.js
foo.js
: a bundle built fromfoo.ts
andbar.ts
foo.js.map
: a sourcemap offoo.js
foo.ts
: the source offoo.js
bar.ts
: the source ofbar.js
If I remove
sourcesContent
fromfoo.js.map
,null
doesn't appear insourcesContent
field ofentry.js.map
.The text was updated successfully, but these errors were encountered: