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

fix: Configure Rollup's external to support subpaths too #722

Merged
merged 1 commit into from Oct 17, 2022

Conversation

amitdahan
Copy link
Contributor

@amitdahan amitdahan commented Sep 19, 2022

Summary

This PR fixes an issue with --dts-resolve.

When relying on types coming from 'some-package/some-subpath', anything that is not imported from 'some-package' would end up getting unnecessarily bundled into the emitted .d.ts bundle.

It seems we were configuring Rollup's external with exact package names.

Here we're adjusting to use the same regex approach taken with esbuild:

// Exclude dependencies, e.g. `lodash`, `lodash/get`
...deps.map((dep) => new RegExp(`^${dep}($|\\/|\\\\)`)),

@vercel
Copy link

vercel bot commented Sep 19, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
tsup ✅ Ready (Inspect) Visit Preview Sep 19, 2022 at 2:17PM (UTC)

@egoist egoist changed the title Configure Rollup's external to support subpaths too fix: Configure Rollup's external to support subpaths too Oct 17, 2022
@egoist egoist merged commit 2f9d370 into egoist:dev Oct 17, 2022
@github-actions
Copy link

🎉 This PR is included in version 6.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

3 participants