I am trying to invoke the Typescript compiler (on Windows via node) with the following command-line:
tsc.cmd -p tsconfig.json --outDir D:\ts-cscript-debugger\out
The current working folder -- and the location of the tsconfig.json -- is D:\DefinitelyTyped\types\activex-wia.
However, the compiler doesn't output anything; the folder passed to outDir remains empty.
Why? How can I get the compiler to output the compiled files?
When I pass the --listFiles parameter, I get a list of all the files to be compiled:
C:/Users/-----/AppData/Roaming/npm/node_modules/typescript/lib/lib.scripthost.d.ts
C:/Users/-----/AppData/Roaming/npm/node_modules/typescript/lib/lib.es5.d.ts
D:/DefinitelyTyped/types/activex-wia/index.d.ts
D:/DefinitelyTyped/types/activex-wia/activex-wia-tests.ts
The tsconfig.json looks like this:
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es5",
"scripthost"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true
},
"files": [
"index.d.ts",
"activex-wia-tests.ts"
]
}
Your tsconfig.json contains "noEmit": true, which specifically instructs the compiler not to emit the Javascript code.
I experienced similar behavior but the noEmit answer didn't help me (because I hadn't set that flag).
In my case, the issue was that I had manually deleted my dist/ directory but neglected to also delete the .tsbuildinfo file, putting it out of sync. TypeScript checked the .tsbuildinfo and determined that it had nothing to do as it believed all of the source files were up to date.
Deleting .tsbuildinfo solved the issue for me.
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