Tsc not excluding node_modules

{ "compilerOptions": { "target": "es5", "module": "commonjs", "moduleResolution": "node", "sourceMap": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "removeComments": false, "noImplicitAny": false }, "exclude": [ "node_modules", "typings/main", "typings/main.d.ts" ] } 

I am trying to upgrade an angular2 / beta8 application to RC1, and I am doing this mainly by restructuring according to the Quickstart guide.

I copied it tsconfig.json to the project directory. I think everything is ready for me, but when I run tsc , I get all kinds of errors in the files in my node_modules folder. Why does he even look there first?

+6
source share
1 answer

I donโ€™t know if you found the answer to this Alex, but the mentioned question / answer in the LDL comments gives the answer submitted by Shrikant Injarapu,

Here's the answer, just in case, if someone doesnโ€™t want to follow this link:

If you are targeting ES5, add "node_modules / typescript / lib / lib.es6.d.ts" to the tsconfig.json file:

  { "compilerOptions": { "module": "commonjs", "target": "es5", "noImplicitAny": false, "outDir": "built", "rootDir": ".", "sourceMap": false }, "files": [ "helloworld.ts", "node_modules/typescript/lib/lib.es6.d.ts" ], "exclude": [ "node_modules" ] } 

EDIT

In my application, I use webpack to create my application, and I still get the same errors that spit out on the console. I am currently looking to fix this and will report on what I find.

+5
source

All Articles