I want to compile TypeScript to one file when using with Node.js.
I have tried configuring "tsconfig.json" like this:
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": false,
"sourceMap": false,
"outFile": "./app/index.js",
"pretty": true,
"types": [
"node"
]
}",
...but when I try with module" set to
"commonjs"`, I get the error:
error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile.
If I change it to "module": "system"
, I get this error when running the file in node
:
ReferenceError: System is not defined
If I change module
to "amd"
, I get this error when running the file in node
:
ReferenceError: define is not defined