I am working on the Angular 2 RC-6 from Angular2 Documentation. I find atom too slow to compile my '.ts' files. If I move my tsconfig.json from root folder to any other directory, it compiles fast but misses some DI such as 'rxjs/add/operator/toPromise'.
Please suggest how to make atom compile fast, or any modification on the tsconfig.json.
My project directory structure is as instructed in documentation.
Here is my tscongig.json file
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false
}
}
Like Daniel said you just need to exclude a few folders. Mainly the node_modules
folder, since there are tons of TypeScript and Javascript files in there.
You can do so by adding the following exclude
option to your tsconfig.json
:
"exclude": [
"node_modules",
"typings/main",
"typings/main.d.ts"
]
Adding this to your current config it would look like this:
{
"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'm adding this here in case anyone else has the same issue as me.
I tried excluding the node_modules folder as suggested in rinukkusu's answer but this ended up breaking the compiler altogether (Atom 1.12.9, Atom-Typescript 10.1.13).
After some hair pulling I added the include option to see what would happen. The documentation doesn't specifically say that both are required but it seemed to fix the problem.
So in my case the config would look like this:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false
},
"include": [
"app/**/*"
],
"exclude": [
"node_modules",
"typings/main",
"typings/main.d.ts"
]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With