Microsoft/TypeScript

error TS5053: Option 'declarationDir' cannot be specified with option 'outFile'.

Open

#12.405 geöffnet am 21. Nov. 2016

Auf GitHub ansehen
 (0 Kommentare) (16 Reaktionen) (0 zugewiesene Personen)TypeScript (6.726 Forks)batch import
Help WantedSuggestion

Repository-Metriken

Stars
 (48.455 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 6T 17h) (9 gemergte PRs in 30 T)

Beschreibung

Attempting to change the declaration file output directory, I get the following error:

error TS5053: Option 'declarationDir' cannot be specified with option 'outFile'.

tsconfig.json looks like this:

{
    "$schema": "http://json.schemastore.org/tsconfig",
    "compilerOptions": {
        "module": "amd",
        "target": "es6",
        "outFile": "../assets/js/main.js",
        "sourceMap": true,
        "declaration": true,
        "declarationDir": "../"
    }
}

I want my .d.ts file emitted somewhere else, since that's not a public asset.

Why is this not permitted?

I'm forced to create two (near-identical) tsconfig files and run the compiler twice to get the declaration file and output file. What for?

Contributor Guide