1

I tried using the following in my tsconfig.json file:

...

"declaration": true,
"rootDir": "./src/",
"outDir": "./lib/",

...

The first time I execute tsc it seems to work fine; but the second time I execute tsc I get an error where tsc complains that it cannot write output because it would overwrite an input file.

It seems that tsc is trying to include the TypeScript declaration files that are written out to my 'lib' directory.

1 Answer 1

3

Just exclude the files in the lib folder:

{
  "compilerOptions": {
      "declaration": true,
      "rootDir": "./src/",
      "outDir": "./lib/",
   }
},
"exclude": [
    "node_modules",
    "lib"
    ]
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.