-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
fix: support composite
in tsconfig.json
#55
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We are using pkgroll with Typescript monorepos (managed by pnpm workspaces) and project references. The latter requires `compilerOptions.composite = true` in referenced projects for most `tsc` invocations. If you set `references` without `compilerOptions.composite = true`, `tsc` will fail, indicating that `composite` needs to be set. When I run `pkgroll` and have `composite` set, I get TS6307 for every file included from `src/index.ts`. rollup-plugin-dts does not handle `composite` (see Swatinem/rollup-plugin-dts#127, which was closed without fix or explanation). I looked at several other related tools (rollup-plugin-typescript2, rollup-plugin-ts, others mentioned in Swatinem/rollup-plugin-dts) and could not get any of them working to build *just* the DTS files (rollup-plugin-typescript2 was the most promising, but I could not get it working in the time that I allotted for this investigation). Going back to rollup-plugin-dts, we find the `compilerOptions` option, and I tried explicitly setting `composite: false`, which allows my type files to build again without errors. I don't think that this is the *correct* fix; ideally, rollup-plugin-dts would be fixed to better handle composite projects *or* would override `composite` at all times. An alternative change, although much more invasive to pkgroll, would be to have pkgroll accept an *alternate* `tsconfig.json` as a parameter: ```console $ pkgroll --tsconfig tsconfig.pkgroll.json ``` In the short term, this has eliminated the build issue that I have been seeing, and it may be sufficient to resolve this until a better fix can be determined in some way, whether by a `--tsconfig` parameter, upstream fixes, or changing to a different bundler plugin for type declaration plugins. This issue can be seen at: https://github.com/halostatue/pkgroll-monorepo-types-issue
privatenumber
changed the title
Fake support composite
fix: support Mar 7, 2024
composite
in tsconfig.json
🎉 This PR is included in version 2.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Spectacular and thank you for the quick response. |
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #54