-
-
Notifications
You must be signed in to change notification settings - Fork 598
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
[@rollup/plugin-typescript] tsconfig declarationDir is ignored when using single file output #1230
Comments
Also confirmed. In
When rollup runs declaration file(s) are placed in the output directory and not specified ( |
This comment was marked as spam.
This comment was marked as spam.
@himanshuchawla009 please do not post "me too," "+1" type replies. They spam anyone who has notifications on for issues (e.g. all maintainers). Please use the reaction buttons on the original post in the issue instead. |
I got the same issue with 8.3.4. Now I have to create new tsconfig.types.json with declaration config |
due to issues in rollup plugin rollup/plugins#1230
I got the issue as well. Reverting back to version 8.3.3 fixes the issue, so it seems it was introduced in the 8.3.4 release. The only change in that release is this; #1201, which may very well be the cause (also there's other people talking about problems there as well). Easiest temporary fix for now: revert back to 8.3.3 and pin this version in your package.json. |
I'm also having this problem with the latest version. And I think I found the problem with the recently merged PR #1201. plugins/packages/typescript/src/index.ts Lines 141 to 155 in 0bbb4fd
Asumming the plugins/packages/typescript/src/index.ts Line 153 in 0bbb4fd
So for example, if user set declarationDir to baseDir = '/some/absolute/path/to/output/types'
id = '/some/absolute/path/to/output/types/foo/bar.d.ts'
filename = relative(baseDir, id) => 'foo/bar.d.ts' we can see, that whatever value the |
This appears to still be an issue as of the latest version, |
I found that there will be similar problems in the case of multi-file output
the error log
Is this caused by the same problem? |
Hey folks. This issue hasn't received any traction for 60 days, so we're going to close this for housekeeping. If this is still an ongoing issue, please do consider contributing a Pull Request to resolve it. Further discussion is always welcome even with the issue closed. If anything actionable is posted in the comments, we'll consider reopening it. ⓘ |
Did this ever get fixed? Or still just sticking with old rollup version for now? |
I'm sticking with the old one at present. I don't believe I saw anything about this getting fixed... |
I use a a hack way to avoid error . use ts to generate .d.ts . use rollup to build ...... |
+1 to get this fixed in the latest Rollup version 🙏 |
After some debugging, I've noticed that this issue comes up if you have a subfolder for the E.g this is the config we had
The error went away when I changed |
Has this problem been solved yet |
The problem is still here. |
Can we re-open this? Its clearly not fixed and an outstanding issue. |
@cristian-eriomenco read this in its entirety and you'll have your answer: #1230 (comment) |
Understood. Not going to fix it. Thanks for clarification. |
I'm not sure how you managed to misunderstand the very clear language in the message that the bot posted. but good luck to you. for onlookers and people who run across this issue in the future, we openly welcome community help to resolve this. the team of maintainers for roll-up is extremely small, and we are stretched extremely thin. we all have jobs and families. |
Having the same problem with the latest versions : @rollup/plugin-typescript: Path of Typescript compiler option 'declarationDir' must be located inside the same directory as the Rollup 'file' option. I have back to those version and everything worked well : "@rollup/plugin-commonjs": "^25.0.3", |
Expected Behavior
Declarations generated at the specified location
Actual Behavior
Declarations generated at the same directory as the output file.
Additional Information
I'm using api-extractor to rollup d.ts files into a single one, so the declarations are output at a place that will be removed after
processing.
This works at version 8.3.1 with a problem that it generates file at relative location under output directory, that is when
declarationDir
istypes
and output.file isdist/index.js
, declarations will be underdist/types
. But after my collegue updated to 8.3.4 (by using ^8.3.1 in package.json), the behavior changes to that declarations generated atdist/
, and the build progress breaks since api-extractor can't find the desired entry for d.ts rollup.The text was updated successfully, but these errors were encountered: