(init-templates/typescript): exclude node_modules
See original GitHub issue❓ Should node_modules
not be excluded from typescript projects in tsconfig
?
The Question
I don’t know whether it is intentional or not, however when initializing a Typescript app the node_modules
are included into the project and will therefore be type checked and so on. This is because you override the default settings of exclude to "exclude": ["cdk.out"]
.
Note: without an exclude list, node_modules is excluded by default; as soon as one is added, it’s important to explicitly add node_modules to the list. (Source: Specifying Files)
Regarding the Performance recommendation by the official Typescript team, it is considered a best practice to exclude node_modules
. This could easily be achieved by adding it to exclude
:
{
// ...
"exclude": [
"node_modules",
"cdk.out"
]
}
If you don’t mind I would create a PR myself. 😃
Environment
- CDK CLI Version: 1.76.0
- Node.js Version: v12.16.2
- OS: macOS Catalina
- Language (Version): ^4.0.2
Other information
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Documentation - What is a tsconfig.json - TypeScript
The tsconfig.json file specifies the root files and the compiler options required to compile the project. JavaScript projects can use a jsconfig.json file ......
Read more >tsconfig.json doesn't exclude folder node_modules properly
Im trying to build my project by command npm run ng build, but it prints me errors from folder node_modules like this.
Read more >Publishing Node modules with TypeScript and ES modules
Publishing Node modules with TypeScript and ES modules ... First, create an empty directory and run npm init -y to create a new...
Read more >How to Bundle JavaScript With Rollup — Step-by-Step Tutorial
support the use of Node modules in the browser,; work with environment variables, and; compress and minify our code for the smallest possible...
Read more >How to optimize a serverless typescript eslint webpack setup ...
Or how I improved the Serverless AWS NodeJS Typescript template ... Include **/*.ts files only and Exclude node_modules and build directories.
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 FreeTop 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
Top GitHub Comments
Hey @bmacher, thank you for working on this! Whenever you are ready feel free to go ahead and create the PR. Integration tests won’t be necessary in this case, as you aren’t changing any actual functionality that should affect any cloudformation output
Thanks @SomayaB, I will work on that.