[英]Output .map files for typescript to specific folder in IntelliJ IDEA
I configured my IntelliJ IDEA to compile all .ts file to specific folder.我将 IntelliJ IDEA 配置为将所有 .ts 文件编译到特定文件夹。 Here's the configuration:
这是配置:
It works just fine.它工作得很好。 Here's my folder structure:
这是我的文件夹结构:
js/
| - typescript/
| - __test.ts
| - __test.js
| - __test.js.map
| - otherfile.js
The problem is that it outputs the .map files to the same folder as .js files.问题是它将 .map 文件输出到与 .js 文件相同的文件夹。 Since I'll be having a lot of .js files, the folder will look cluttered.
由于我将有很多 .js 文件,文件夹看起来会很混乱。
Is there a possibility to make IntelliJ IDEA to output .map files to a specific folder?是否有可能让 IntelliJ IDEA 将 .map 文件输出到特定文件夹? I couldn't find any info about that...
我找不到任何关于它的信息......
Thank you!谢谢!
tsc compiler doesn't have options for this - .map
files, when generated, are always placed to the same folder as .js
files. tsc 编译器没有这方面的选项 -
.map
文件在生成时总是与.js
文件放在同一文件夹中。 See https://www.typescriptlang.org/docs/handbook/compiler-options.html for the list of available options.有关可用选项的列表,请参阅https://www.typescriptlang.org/docs/handbook/compiler-options.html 。
if you like to move generated files to a different location, you can use build tools like Gulp, Grunt or Webpack.如果您想将生成的文件移动到不同的位置,您可以使用 Gulp、Grunt 或 Webpack 等构建工具。 But, if you go this way, make sure that sourcemaps URL is properly generated (you need using
--mapRoot
cli option that controls the reference to the map file in the .js
file to let the debugger know where to look for sourcemaps).但是,如果您采用这种方式,请确保正确生成了源映射 URL(您需要使用
--mapRoot
cli 选项来控制对.js
文件中映射文件的引用,以让调试器知道在哪里查找源映射)。
see TypeScript tsconfig Output files in certain folders , for example例如,请参阅特定文件夹中的 TypeScript tsconfig 输出文件
in the Typescript Compiler options... I added --outDir ./.map
.在打字稿编译器选项中...我添加了
--outDir ./.map
。 This affects both .js
and .js.map
files.这会影响
.js
和.js.map
文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.