Search code examples
typescriptintellij-ideadeclarationtsconfig

Typescript in IntelliJ not generating js files when tsconfig declaration is turned on


I have the following in my tsconfig file:

{
    "compilerOptions": {
        "module": "ESNext",
        "target": "es6",
        "sourceMap": true,
        "rootDir": "./",
        "outDir": "static/gen/",
        "include": ["test/**/*"],
        "declaration": true,
        "emitDeclarationOnly": false
    },
}

Whenever "declaration" is turned on the .js files stop being generated from the .ts files. Everything works fine until I turn on "declaraction" (with "emitDeclarationOnly" as false).

I am correct in thinking that .js files ARE supposed to be generated when declaration is turned on (with emitDeclarationOnly=false), correct? Any idea why this may be happening?


Solution

  • The problem was that I had the include directive inside the compilerOptions directive, but it needed to be in the root of the config.