我想在 NERDTree 中隐藏 TypeScript 转换器生成的自动文件(.js .js.map)。
感谢 Hussein Nazzal,我通过以下方式解决了问题(因为我使用的是Angular2,所以需要注意一些步骤):
Add an outDir property to tsconfig.json this way:
{
"compilerOptions": {
"target": "es5",
"module": "system",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"outDir": "buildjs/"
},
"exclude": [
"node_modules",
"typings/main",
"typings/main.d.ts"
]
}
Then in .vimrc
file add the following:
let NERDTreeIgnore=['buildjs$']
Don't forget to modify index.html
and add the following line near System.import('buildjs/main')
,
System.import('app/main')`
add to System.config
map: {
app: 'buildjs'
}
to hide files use the NERDTreeIgnore
let NERDTreeIgnore = ['\.js$' , '\.js.map$']
vimrc
文件中。--outFile
,那么您可以指定输出文件为 somefile.generated.ts
并将 '.generated.ts$' 添加到忽略列表中。如果您正在使用 gulp,您也可以做类似的事情... 但是没有其他方法可以知道文件是否是生成的文件。但是,如果您将文件输出到 dist
目录中,您也可以隐藏该目录。 - Hussein Nazzallet NERDTreeShowHidden=0
index.html
中调整System.config
- 不要这样做 :) 相反,请更改systems.config.js
中的映射。 - tmadsen