Search code examples
typescripttsctsconfig

Unknown compiler option 'outFile'


I was trying to compile some TypeScript files to single JavaScript. Getting error as below

error TS5023: Unknown compiler option 'outFile'.

I compile it by command tsc. if I use outDir, the .ts files are compiling as expected to .js but seperately.

My tsconfig.json

{
"compilerOptions": {
    "module": "system",
    "noImplicitAny": true,
    "removeComments": true,
    "preserveConstEnums": true,
    "outFile": "../../built/local/tsc.js",
    "sourceMap": true
    },
    "include": [
        "src/**/*"
    ],
    "exclude": [
        "node_modules",
        "**/*.spec.ts"
    ]
}

TypeScript version : 2.6.2

I tried changing the module, but no positive result. How can I overcome this?


Solution

  • Do you have multiple versions of TypeScript installed? You are likely (unknowingly) compiling with a 1.x compiler. outFile was added in 2.0.