Ignoring "exclude" from tsconfig.json
See original GitHub issueI’m pretty sure ts-node is ignoring the exclude option in tsconfig.json. I get no errors when using tsc directly.
tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"target": "es5",
"allowJs": true,
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"types": [
"node"
]
},
"exclude": [
"node_modules",
]
}
ts-node main.ts
~/.nvm/versions/node/v6.7.0/lib/node_modules/ts-node/src/index.ts:308
throw new TSError(diagnosticList)
^
TSError: ⨯ Unable to compile TypeScript
node_modules/json-schema/lib/validate.js (43,10): Duplicate identifier 'validate'. (2300)
node_modules/json-schema/lib/validate.js (68,5): Duplicate identifier 'validate'. (2300)
at getOutput (~/.nvm/versions/node/v6.7.0/lib/node_modules/ts-node/src/index.ts:308:17)
at ~/.nvm/versions/node/v6.7.0/lib/node_modules/ts-node/src/index.ts:334:18
at Object.compile (~/.nvm/versions/node/v6.7.0/lib/node_modules/ts-node/src/index.ts:488:17)
at Module.m._compile (~/.nvm/versions/node/v6.7.0/lib/node_modules/ts-node/src/index.ts:392:44)
at Module._extensions..js (module.js:565:10)
at Object.require.extensions.(anonymous function) [as .js] (~/.nvm/versions/node/v6.7.0/lib/node_modules/ts-node/src/index.ts:395:12)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
Also I know there is a duplicate identifier error in json-schema but using tsc main.ts and then node main.js works correctly with no changes.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:12 (6 by maintainers)
Top Results From Across the Web
"exclude" property of tsconfig.json is not being respected
As for include/exclude not working, I believe it is because of "dependencies." Even if you exclude a folder, if an imported file (like...
Read more >Exclude a Folder from compilation with tsconfig.json in TS
Use the exclude option in your tsconfig.json file to exclude a folder from compilation in TypeScript. The exclude option changes what the include...
Read more >tsconfig exclude field not working · Issue #38475 - GitHub
Using TSC 3.8.3, run tsc --init . In the tsconfig.json file, add the line: exclude: ["**/node_modules/*"]. Add a package.json dependency ...
Read more >Typescript Compiler not ignoring excluded paths - YouTrack
1. Add a directory (root -> directory) with typescript files in it. · 2. Add this directory to the "exclude" option in the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
How did you added it, It doesn’t work for me. can you provide an example? thanks
That fixed it. Thank you!