我可以在Atom中隐藏自动生成的Typescript .js和.map.js文件吗? [英] Can I hide typescript autogenerated .js and .map.js files in atom?

查看:103
本文介绍了我可以在Atom中隐藏自动生成的Typescript .js和.map.js文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道在Atom中是否存在用于隐藏或分组自动生成的文件的插件/选项?

Does anyone know if there is a plugin/option for hiding or grouping autogenerated files in Atom?

我要隐藏/分组的文件是typescript compiler自动生成的文件(.js.map.js文件).

The files I want hidden/grouped is what the typescript compiler auto generates (.js and .map.js files).

如果可能,最好使用Visual Studio样式分组

Visual Studio style grouping would be best, if possible

我的打字稿文件 file.ts

生成 file.js file.map.js

file.js偶尔阅读很有趣,但是一般来说它是自动生成的,我不关心它.

file.js is interesting to read once in a while, but in general its autogenerated and I shouldn't care about it.

因此,让file.ts为虚拟文件夹,如

So letting file.ts be a virtual folder like

- file.ts
  - file.js
  - file.map.js

将是理想的解决方案.

简单隐藏即可. (通常隐藏.js文件不是解决方案,因为打字稿项目通常会混合.js.ts甚至是.tsx文件)

Plain hiding is fine. (hiding .js files in general is not a solution, since typescript projects typically mix .js, .ts and even .tsx files)

推荐答案

Atom尊重.gitignore并将所有与.gitignore匹配的文件灰显,这些文件将放置在项目的根目录中.这足以忽略生成的文件:

Atom respects .gitignore and will grey out any files matching your .gitignore which you place in the root of your project. This should be sufficient to ignore generated files:

*.js
*.jsx

此外,您的tsconfig.json可以将所有文件输出到另一个路径.例如:

In addition, your tsconfig.json can output all your files into another path. For example:

{
  "version": "1.6.2",
  "compilerOptions": {
    "outDir": "build"
    "sourceMap": true
  },
  "filesGlob": [
    "./src/**/*.ts",
    "./src/**/*.tsx"
  ]
}

这将通知tscatom-typescript将位于src中的所有TypeScript文件输出到build.

This will inform tsc and atom-typescript to output all the TypeScript files located in src into build.

这篇关于我可以在Atom中隐藏自动生成的Typescript .js和.map.js文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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