Skip to content

Conversation

@timofei-iatsenko
Copy link
Collaborator

@timofei-iatsenko timofei-iatsenko commented Nov 10, 2025

Description

Reconsider deps externalization in the experimental extractor.

Before

it used a packages: external from esbuild which is:

This setting considers all import paths that "look like" package imports in the original source code to be package imports. Specifically import paths that don't start with a path segment of / or . or .. are considered to be package imports. The only two exceptions to this rule are subpath imports (which start with a # character) and TypeScript path remappings via paths and/or baseUrl in tsconfig.json (which are applied first).

Despite that sounds ok, it made impossible to include dependecies from monorepo which are not using typescript path aliases.

Current

All import paths that "look like" package imports including typescript path aliases are ignored. You have to manually specify what you want to be included in analyzing using includeDeps.

Migration path

This is a breaking change for experimental extractor (since it's experimental we don't bump the major version for that change) users have to migrate their configurations to support this change.

  1. If you had resolveEsbuildOptions option which unsets packages: external you can delete it now.
  2. You have to list packages mapped using TypeScript Path aliases manually in the includeDeps option.
  3. If you used Typescript Path aliases to map the code inside one package - you have to reconsider this
    • use subpath imports instead (this more future proof and standard way to handling this)
    • tune esbuild config using resolveEsbuildOptions for your project. For example setup aliases to match tsconfig paths.

Motivation

It's quite hard to find a right settings to "rule them all", one configuration would suits better monorepos with path aliases another with package symlinks thru the pnpm.

This new settings is more aligned with modern monorepo layout proposed by NX, and should s

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Examples update

Fixes #1973 #2250

Checklist

  • I have read the CONTRIBUTING and CODE_OF_CONDUCT docs
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)

@vercel
Copy link

vercel bot commented Nov 10, 2025

@timofei-iatsenko is attempting to deploy a commit to the Crowdin Team on Vercel.

A member of the Team first needs to authorize it.

@codecov
Copy link

codecov bot commented Nov 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.34%. Comparing base (6bb8983) to head (2ff66bc).
⚠️ Report is 231 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2362      +/-   ##
==========================================
- Coverage   77.05%   76.34%   -0.71%     
==========================================
  Files          84      100      +16     
  Lines        2157     2659     +502     
  Branches      555      694     +139     
==========================================
+ Hits         1662     2030     +368     
- Misses        382      505     +123     
- Partials      113      124      +11     

☔ 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.

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.

v5 experimental extractor esbuild "packages" config

1 participant