在处理 Angular2-typescript 项目时如何在 WebStorm 中隐藏 .js 和 .map 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36183470/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to hide .js and .map files in WebStorm while working on Angular2-typescript project
提问by runtimeZero
回答by sleidig
When using WebStorm without the built-in TypeScript Compiler (e.g. because you are running an Angular2 project with their npm start
script which does the compiling already) and the other method doesn't work, you can configure your own filtered "Project" panel for WebStorm:
当在没有内置 TypeScript 编译器的情况下使用 WebStorm 时(例如,因为您正在运行一个 Angular2 项目,其npm start
脚本已经进行了编译)并且其他方法不起作用,您可以为 WebStorm 配置您自己的过滤“项目”面板:
- Select
Project Files
section of the side panel (Project
section does not offer the needed config menu) - Click on the gear icon to configure
- Select "Edit Scopes" from that menu
- Add a new Scope
- Set the Pattern to an appropriate filter to exclude the
*.js
and*.js.map
files (I am using!file[my-root-folder]:app//*.js&&!file[my-root-folder]:app//*.js.map
) - You can select this scope as a section of the side panel (instead of
Project
orProject Files
) under the name you set the scope.
回答by Ankit Singh
回答by sleidig
For me, using the Project
panel, rather than the Project Files
panel did the trick collapsing the *.js
and .js.map
files and hiding them beneath their corresponding *.ts
file.
对我来说,使用Project
面板而不是Project Files
面板来完成折叠*.js
和.js.map
文件并将它们隐藏在相应*.ts
文件下的技巧。
Note: This is only working when WebStorm's TypeScript Compiler is enabled. (see A_Singh's answer)
注意:这仅在启用 WebStorm 的 TypeScript 编译器时有效。(见 A_Singh 的回答)