Search Terms
TypeScript, Compiler Options, Source Maps, Declaration Files
Suggestion
Currently, there exist the TypeScript compiler options sourceMap, inlineSourceMap, inlineSources, declaration, declarationMap, and declarationDir but there is no way to tell the compiler the folder for the source map files and the declaration map files. The declaration map cannot be part of the declaration file, too, and the source code cannot be inlined into a declaration map.
Therefore, please add the compiler options:
sourceMapDir: the folder of the emitted source map files;
declarationMapDir: the folder of the declaration map files;
inlineDeclarationMap: the declaration map is put into the declaration file using a comment;
declarationMapInlineSources: the source code becomes part of the declaration map similar to the option inlineSources for generated JavaScript files inlining TypeScript sources.
The options inlineDeclarationMap and declarationMapInlineSources should also be usable together. It is similar to using inlineSourceMap and inlineSources together.
Using Gulp together with gulp-typescript and gulp-sourcemaps there is already the possibility to specify a source map folder and declaration map folder using sourcemaps.write("<folder>", options) but it would be better to have that possibility as part of a TypeScript compiler option.
Use Cases
Of course, these compiler options are not necessary in most cases but they open up more flexibility to the user, and the implemetation should not be very difficult.
At least the option inlineDeclarationMap would reduce the cluttering of files in the declarationDir folder, and declarationMapInlineSources together with inlineDeclarationMap would make it possible to ship a declaration file with the sources as one file.
Checklist
My suggestion meets these guidelines:
Search Terms
TypeScript, Compiler Options, Source Maps, Declaration Files
Suggestion
Currently, there exist the TypeScript compiler options
sourceMap,inlineSourceMap,inlineSources,declaration,declarationMap, anddeclarationDirbut there is no way to tell the compiler the folder for the source map files and the declaration map files. The declaration map cannot be part of the declaration file, too, and the source code cannot be inlined into a declaration map.Therefore, please add the compiler options:
sourceMapDir: the folder of the emitted source map files;declarationMapDir: the folder of the declaration map files;inlineDeclarationMap: the declaration map is put into the declaration file using a comment;declarationMapInlineSources: the source code becomes part of the declaration map similar to the optioninlineSourcesfor generated JavaScript files inlining TypeScript sources.The options
inlineDeclarationMapanddeclarationMapInlineSourcesshould also be usable together. It is similar to usinginlineSourceMapandinlineSourcestogether.Using Gulp together with
gulp-typescriptandgulp-sourcemapsthere is already the possibility to specify a source map folder and declaration map folder usingsourcemaps.write("<folder>", options)but it would be better to have that possibility as part of a TypeScript compiler option.Use Cases
Of course, these compiler options are not necessary in most cases but they open up more flexibility to the user, and the implemetation should not be very difficult.
At least the option
inlineDeclarationMapwould reduce the cluttering of files in thedeclarationDirfolder, anddeclarationMapInlineSourcestogether withinlineDeclarationMapwould make it possible to ship a declaration file with the sources as one file.Checklist
My suggestion meets these guidelines: