My directory structure:
frontend
-- node_modules
backend
-- node_modules
In my tsconfig.json, I have:
"exclude": [
"frontend/node_modules", "backend/node_modules"
]
Still, I get errors from packages in node_modules.
What am I doing wrong?
// Per
Why "exclude"
doesn't work:
"exclude"
only prevents items from being included by"include"
; it doesn't prevent them from being included viaimport
statements or<reference>
s. If you import [the module]levelup
, andlevelup
importsleveldown
, then excludingleveldown
ornode_modules
won't have an effect. (reddit)
TS reference: https://www.typescriptlang.org/tsconfig#exclude
Maybe you should try the option --skipLibCheck
.
See also the FAQ: Why is a file in the exclude list still picked up by the compiler?
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