How tsconfig exclude pattern should actually work
See original GitHub issueTypeScript Version: 2.1.1 / nightly (2.2.0-dev.201xxxxx)
Say we have a following structure to specially to test exclude
pattern:
/node_modules
/module/some.ts
nested/
/node_modules
/module/some.ts
/deep-nested/
/node_modules
/module/some.ts
Will check this using tsc --listFiles
How exclude patterns work:
- “node_modules” - will exclude only
/node_modules/module/some.ts
- “*/node_modules” (the same effect as /node_modules/") - will exclude only
/nested/node_modules/module/some.ts
- “**/node_modules” - will exclude nothing
- “**/node_modules/*” - will exclude everything (also nested, deep-nested)
Some behaviour seem strange to me
- why in case 3 it excludes nothing (considering case 2 works)?
- by default (if
exclude
not specified) case 1 will be effective, shouldn’t it be 4) which excludesnode_modules
in nested folders as well?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:7
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Exclude using a pattern in tsconfig.json in TypeScript
Use wildcard characters to exclude using a pattern in tsconfig.json . The exclude array in the tsconfig.json file supports wild card characters to...
Read more >Exclude with pattern in tsconfig.json - typescript - Stack Overflow
Exclude with pattern in tsconfig.json · 1 · 1 · Adding them in filesGlob will cause the files list to appear and I'm...
Read more >TSConfig Reference - Docs on every TSConfig option
Specifies an array of filenames or patterns that should be skipped when resolving include . Important: exclude only changes which files are included...
Read more >Configuring TypeScript compiler - inDepthDev
It's used to control the output directory structure alongside with outDir . If you want to exclude some files or folders from the...
Read more >Understanding TypeScript Configuration Options
You can specify the files not to be compiled in the program using an array of filenames or the glob pattern. Normally it...
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
Yes but I think default should provide smart defaults, and I think if Ts so smart that event excludes three most common PM’s fiolders (
node_modules
,bower_components
,jspm_modules
), it could also be smart enough to do it for nested folders as well.possibly would consider it. the defaults are not meant to be comprehensive thought. it is just a starting point to get most users covered. you can always add additional ones by defining your own exclude patterns.