I want to hide the auto generated files (.js .js.map) by Typescript transpiler in NERDTree.
How can hide autogenerated files by TypeScript in NerdTree?
Asked Answered
Thanks to Hussein Nazzal, I've managed to solve it this way (because I'm using Angular2 there are a couple of steps to be aware):
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 nearSystem.import('buildjs/main')
,System.import('app/main')`
add to
System.config
map: { app: 'buildjs' }
This is the best answer. I used 'dist' instead of 'buildjs', but this worked great. Thanks! –
Malinowski
Great. I tried fiddling with
System.config
in index.html
- don't do that :) Change the mapping in systems.config.js
instead. –
Pilgarlic Not a huge fan of this method, you're not hiding autogenerated files, you're simply generating them in a different directory. –
Sharpsighted
to hide files use the NERDTreeIgnore
let NERDTreeIgnore = ['\.js$' , '\.js.map$']
the following line should be used in your vimrc
file
the problem is, I don't want to hide javascript files, only the auto generated by typescript. –
Cannady
this will depend on the method used for transpiling files ... do you use ` --outFile` if you do then you could specify out file to be
somefile.generated.ts
and add '\.generated.ts$' to the ignore list. if you are using gulp you could do similar thing as well .. but there is no other ways to know if the file is a generated file or other wise.but if you output your files in a dist
directory you might as well hide the dir –
Initiative I'm using angular2 configuration, I guess there's have to be a way to configure it using the tsconfig.json file. –
Cannady
then just specify "outDir" and hide the folder ... or concatenate your files using "outFile" here is a list of ts config options json.schemastore.org/tsconfig –
Initiative
I think what @WernerEchezuria wants is to hide .js files if a .ts file by the same name (minus the extension) exists in the same directory. At least that's what I would like to figure out how to do. –
Akihito
If you type I (uppercase i) in NERDTree you can toggle the visibility of hidden files.
To hide the files by default put this line in your vimrc:
let NERDTreeShowHidden=0
The problem is angular doens't build them with a
.
prefix. –
Sharpsighted © 2022 - 2024 — McMap. All rights reserved.