π Search Terms
- sourceMappingURL
- sourceMap
β
Viability Checklist
β Suggestion
There should be a compilerOption to disable inclusion of sourceMappingURL in the generated .js file when sourceMap is true.
π Motivating Example
When sourceMap is true in tsconfig.json, TypeScript compiler generates .map file together with .js file and also include sourceMappingURL 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:
- set
sourceMap to true
- run
npx tsc
- set
sourceMap to false
- run
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?
- set
sourceMap to true
- run
npx tsc
- set
sourceMap to false
- run
npx tsc once again.
π Search Terms
β Viability Checklist
β Suggestion
There should be a compilerOption to disable inclusion of
sourceMappingURLin the generated.jsfile whensourceMapistrue.π Motivating Example
When
sourceMapistruein tsconfig.json, TypeScript compiler generates.mapfile together with.jsfile and also includesourceMappingURLin.jsfile.The inclusion of
sourceMappingURLin.jsfile 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
sourceMappingURLin.jsfile, I have to:sourceMaptotruenpx tscsourceMaptofalsenpx tsconce again.There should provide a compilerOption to disable inclusion of
sourceMappingURLin the generated.jsfile.π» 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
.jsfile.What shortcomings exist with current approaches?
sourceMappingURLis included in.jsfile.What workarounds are you using in the meantime?
sourceMaptotruenpx tscsourceMaptofalsenpx tsconce again.