-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support a 'declarationPath' option #6482
Comments
After discussing with @mhegazy, we think that it would be more appropriate to copy your Additionally, given that external definition files currently should not be bundled with packages, this might facilitate certain anti-patterns that we do not want to encourage. |
Actually, reopening since there is a valid second scenario, in which a user wants to separate their output js from their declaration files. |
Tracking at #6723 now |
When declaration files are supposed to be stored in a separate output folder, deeper in the hierarchy, references in external
.d.ts
files break becauseTSC
currently doesn't support this.I propose to provide an option for having declaration files stored in a separate folder, so
TSC
may amend the corresponding reference paths in the generated code files.In particular, I'm proposing to replace the boolean
declaration
option with adeclarationPath
string option.The path to be set here is suggested to be the relative path between the generated
.js
file and its corresponding.d.ts
file. This would match the behaviour ofgulp-sourcemaps
:- `declarationPath: null` (default value) would not generate `.d.ts` files. - `declarationPath: "."` and `declarationPath: ""` would generate declaration files in the same folder as the generated `.js` files (standard case). - Any other value amends all references to `.d.ts` files pointing to (relative) locations within the project.
See SetTrend/TS18N demo failing project for reference ...
/cc #6465
Your thoughts?
The text was updated successfully, but these errors were encountered: