我可以在Atom中隐藏自动生成的Typescript .js和.map.js文件吗? [英] Can I hide typescript autogenerated .js and .map.js files in atom?
问题描述
有人知道在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"
]
}
这将通知tsc
和atom-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屋!