我正在使用Sublime Typescript插件來轉錄Typescript文件。無法將SourceMap(.map)文件移動到Typescript中的單獨文件夾中
項目文件夾
我已經做了所有的設置的示例項目與tsconfig.json的幫助(使用1.5V打字稿)。下面是我tsconfig.json
{
"compilerOptions": {
"declaration":false,
"mapRoot":"mapFiles",
"module": "commonjs",
"noImplicitAny": true,
"outDir": "js",
"preserveConstEnums": true,
"removeComments": true,
"sourceMap": true,
"sourceRoot": "mapFiles",
"target":"es3",
"watch":true,
"rootDir":""
}
}
要將所有sourceMap文件移動到其他文件夾(映射文件)的文件夾,而不是在同一個文件夾中的所有文件(.js文件和文件.MAP)保持一致,我已經下面添加到配置tsconfig.json
"mapRoot":"mapFiles",
"sourceMap": true,
"sourceRoot": "mapFiles",
完成構建之後,腳本文件與sourceMappingURL意見一起成功生成。下面是出來的main.ts文件。
var x = "will work";
//# sourceMappingURL=E:/type/projects/Examples/ex1/mapFiles/main.js.map
但main.js.map文件沒有移動相應的文件夾(mapFiles)。它位於生成js文件的相同文件夾中。
Below is my understanding about .maps files:
1. Map files have the details about the respective .ts files with location of it.
2. it is used to track down .ts files easily.
請讓我知道如何在運行時將sourceMap文件移動到其他文件夾。