After successfully compiling everything from Typescript to ES6 to ES5, I encountered an error that has me stumped. The error message reads as follows:
Error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher.
Here is the setup details:
- typescript 1.5.0-beta installed (npm install -g [email protected])
- tsconfig.json file included below.
- Two folders being used: src (contains all *.ts files) and typings (holds external library *.d.ts files).
- Atom editor automatically populates "files" property in tsconfig.json.
- ES6 files are transpiled to ES5 using Babel.
Contents of tsconfig.json file:
{
"version": "1.5.0-beta",
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"emitDecoratorMetadata": true,
"declaration": false,
"noImplicitAny": false,
"removeComments": true,
"noLib": false,
"preserveConstEnums": true,
"suppressImplicitAnyIndexErrors": true,
"sourceMap": true,
"outDir": "build"
},
"filesGlob": [
"./src/**/*.ts",
"./typings/**/*.ts",
"!./node_modules/**/*"
],
"files": [ redacted ]
}