Skip to content

Commit

Permalink
Specify rootDir so that declarations can always be emitted with the c…
Browse files Browse the repository at this point in the history
…orrect paths.
  • Loading branch information
NullVoxPopuli authored Dec 6, 2023
1 parent 99d8a81 commit 3cee6d6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions files/__addonLocation__/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@
"allowJs": true,
"declarationDir": "declarations",

/**
https://www.typescriptlang.org/tsconfig#rootDir
"Default: The longest common path of all non-declaration input files."
Because we want our declarations' structure to match our rollup output,
we need this "rootDir" to match the "srcDir" in the rollup.config.mjs.
This way, we can have simpler `package.json#exports` that matches
imports to files on disk
*/
"rootDir": "./src",

/**
We don't want to include types dependencies in our compiled output, so tell TypeScript
to enforce using `import type` instead of `import` for Types.
Expand Down

0 comments on commit 3cee6d6

Please sign in to comment.