Skip to content

fix: guard optional Babel dependency tracking API#573

Open
longnt0108 wants to merge 1 commit into
goatandsheep:mainfrom
longnt0108:fix-optional-add-external-dependency
Open

fix: guard optional Babel dependency tracking API#573
longnt0108 wants to merge 1 commit into
goatandsheep:mainfrom
longnt0108:fix-optional-add-external-dependency

Conversation

@longnt0108
Copy link
Copy Markdown

Summary

  • Guard api.addExternalDependency so older Babel API objects do not throw.
  • Add regression coverage for Babel API versions without addExternalDependency.

Tests

  • yarn test
  • yarn lint

@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (24b7af1) to head (b285d18).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #573   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           84        85    +1     
=========================================
+ Hits            84        85    +1     

☔ View full report in Codecov by Sentry.
📢 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.

@longnt0108
Copy link
Copy Markdown
Author

Hi, this fixes compatibility with older Babel API objects where api.addExternalDependency is unavailable. I added a regression test and verified
yarn test and yarn lint locally.

@goatandsheep
Copy link
Copy Markdown
Owner

goatandsheep commented May 14, 2026

Hi @longnt0108 this seems fine. What versions of Babel are you targeting? This feature was added quite a while back.

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.

2 participants