When attempting to exclude a *.ts file from compilation by adding it to the "exclude" property in tsconfig.json, I am facing an issue. If I import that excluded file somewhere in the code, TypeScript ignores the exclusion and compiles it anyway. How can I ensure that TS truly excludes this file?
../
../must_be_excluded.ts
../index.ts
Using import
//index.ts
import {some_stuff} from "./must_be_excluded"
Tsconfig settings
//tsconfig.json
{
"compilerOptions": {...},
"exclude": ["./must_be_excluded.ts"]
}
Even with the exclusion specified in tsconfig.json, the must_be_excluded.js file is still being compiled!