Skip to content

build: externalize all bare imports in package bundles - #1386

Merged
dangreen merged 1 commit into
masterfrom
build/externalize-bare-imports
Dec 4, 2026
Merged

dangreen merged 1 commit into
masterfrom
build/externalize-bare-imports

Conversation

@dangreen

@dangreen dangreen commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Why

build.rolldownOptions.external named the packages to leave out of the bundle by hand, so a new dependency had to be added there as well, or it would end up bundled.

What

The bundle now leaves out each bare import, so only the package's own sources go into it:

external: id => !id.startsWith('.') && !isAbsolute(id)

The absolute path check keeps the package's own modules in the bundle, since external also gets resolved ids, which are absolute paths.

Notes

  • The package was built before and after the change: every file of dist is byte-for-byte the same, and react and chart.js are still imported, not bundled.

@codecov

codecov Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.97%. Comparing base (b323b92) to head (137953b).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1386   +/-   ##
=======================================
  Coverage   93.97%   93.97%           
=======================================
  Files           3        3           
  Lines          83       83           
  Branches       20       20           
=======================================
  Hits           78       78           
  Misses          3        3           
  Partials        2        2           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dangreen
dangreen marked this pull request as ready for review December 4, 2026 12:34
@dangreen
dangreen merged commit 786ef82 into master Dec 4, 2026
11 checks passed
@dangreen
dangreen deleted the build/externalize-bare-imports branch December 4, 2026 12:34
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

Successfully merging this pull request may close these issues.

1 participant