Here's my tsconfig.json
{
"compileOnSave": true,
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"target": "ES3",
"lib": ["ESNext"],
"strict": false,
"moduleResolution": "node",
"module": "commonjs",
"types": ["C:\\Web\\XChecker\\XwChecker\\Rulesets\\d.ts"],
"removeComments": true
},
"include": ["*.ts"]
}
My project has a number of .ts files and a file of types in d.ts/index.d.ts
.
I want to compile just one, JUST ONE, of the .ts files in my project and output it to a file with an .rr
extension.
Now the --outFile
works but I can't figure out what the CLI is supposed to be told such that all the settings in the tsconfig.json
apply. Currently I get a screenful of errors about TS2304: Cannot find name 'blah'
Yeah, need help!
Top comments (1)
To answer my own question, based on the response on StackOverflow, one needs to create a file-specific version of the tsconfig.json and use that when compiling the single file.
So here's the original
tsconfig.json
:I now have a separate
BOML.tsconfig
file (BOML is the name of the single target in this case) which is:To compile:
npx tsc -p boml.tsconfig
and I get a niceboml.rr
at the end