Open sudo-barun opened 2 months ago
Seems like the HTTP server could strip this automatically if it knows that it's sending a SourceMap
header
@RyanCavanaugh By "the HTTP server", are you referring to the http-server package?
Even if some server has such stripping feature, it does not look like standard behavior for a web server to have. Popular servers like Apache httpd and nginx do not have that feature.
I mean the abstract concept of an HTTP server that is in charge of the content it sends to the receiver
🔍 Search Terms
✅ Viability Checklist
⭐ Suggestion
There should be a compilerOption to disable inclusion of
sourceMappingURL
in the generated.js
file whensourceMap
istrue
.📃 Motivating Example
When
sourceMap
istrue
in tsconfig.json, TypeScript compiler generates.map
file together with.js
file and also includesourceMappingURL
in.js
file.The inclusion of
sourceMappingURL
in.js
file is one way of linking generated code with sourcemap. Another way is to use SourceMap header.Right now, to make use of SourceMap header without including
sourceMappingURL
in.js
file, I have to:sourceMap
totrue
npx tsc
sourceMap
tofalse
npx tsc
once again.There should provide a compilerOption to disable inclusion of
sourceMappingURL
in the generated.js
file.💻 Use Cases
What do you want to use this for? I want to use this to use SourceMap header without getting warning in browser. The benefit of using SourceMap header is that the linking of generated file to map file can be controlled by the server without regenerating
.js
file.What shortcomings exist with current approaches?
sourceMappingURL
is included in.js
file.What workarounds are you using in the meantime?
sourceMap
totrue
npx tsc
sourceMap
tofalse
npx tsc
once again.