Skip to content
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

Does not bundle adjacent monorepo dependencies #192

Closed
3 tasks done
shennan opened this issue Jan 13, 2022 · 2 comments
Closed
3 tasks done

Does not bundle adjacent monorepo dependencies #192

shennan opened this issue Jan 13, 2022 · 2 comments

Comments

@shennan
Copy link

shennan commented Jan 13, 2022

Checklist

  • I can reproduce this issue when running this plugin on its own.
    Other plugins, such as node-resolve are known to cause issues.
  • I am running this plugin on .d.ts files generated by TypeScript.
    The plugin can consume .ts and even .js files (with allowJs: true), but this is known to cause issues.
  • This issue is not related to rolling up @types.
    The plugin ignores these by default, unless respectExternal is set. @types can contain hand-crafted code which is known to cause issues.

Code Snipped

I have a Yarn Wokspace monorepo. There's only one package from this monorepo that I "bundle" with rollup, but it depends on imported types from other adjacent packages within the monorepo. These types are not bundled when creating an index.d.ts with this plugin.

This is a problem because when the bundled package is used from outside the monorepo, it requires linking of all the other monorepo packages, which is not a good developer experience. What I want is for the types to be copied over if they have been brought from another package in my monorepo.

Is this possible with rollup-plugin-dts? Using the boilerplate example on your README (after using a seperate build config to convert from typescript) the resulting index.d.ts just contains import { SomeType } from '@my-monorepo/some/file' rather than bundling the contents of that file in preparation for external use.

If I use respectExternal (which I presume bundles all node_modules referenced) then it tries to bundle external packages (available on npm) that I don't want. And besides, it seems to choke on "use strict" in EventEmitter package so I can't even tell if it would work, were I able to narrow-down the packages to only include my own.

Error Message

No errors unless I try to "respectExternal".

@shennan
Copy link
Author

shennan commented Nov 11, 2023

I don't think this issue should be closed on the basis that the project is now in maintenance mode. Closing it implies that it is resolved.

@baginskijakub
Copy link

Same exact issue here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants