在Angular2-typescript项目上工作时如何在WebStorm中隐藏.js和.map文件 [英] How to hide .js and .map files in WebStorm while working on Angular2-typescript project

查看:348
本文介绍了在Angular2-typescript项目上工作时如何在WebStorm中隐藏.js和.map文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将扩展名添加到.gitignore,但结果如下:

I tried adding the extensions to .gitignore but the result is as below:

文件没有完全隐藏.

推荐答案

在不使用内置TypeScript编译器的情况下使用WebStorm时(例如,因为您正在运行带有npm start脚本的Angular2项目,而该脚本已经进行了编译)和其他方法不起作用,则可以为WebStorm配置过滤的项目"面板:

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:

  1. 选择侧面板的Project Files部分(Project部分不提供所需的配置菜单)
  2. 单击齿轮图标以配置
  3. 从该菜单中选择编辑范围"
  4. 添加新的作用域
  5. 将模式"设置为适当的过滤器以排除*.js*.js.map文件(我正在使用!file[my-root-folder]:app//*.js&&!file[my-root-folder]:app//*.js.map)
  6. 您可以在设置范围的名称下选择此范围作为侧面板的一部分(而不是ProjectProject Files).
  1. Select Project Files section of the side panel (Project section does not offer the needed config menu)
  2. Click on the gear icon to configure
  3. Select "Edit Scopes" from that menu
  4. Add a new Scope
  5. 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)
  6. You can select this scope as a section of the side panel (instead of Project or Project Files) under the name you set the scope.

这篇关于在Angular2-typescript项目上工作时如何在WebStorm中隐藏.js和.map文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆