Skip to content

perf(deps): read each package.json once when resolving dep subpaths - #1093

Open
Cherry wants to merge 1 commit into
rolldown:mainfrom
Cherry:perf/cache-dep-subpath-exports
Open

Cherry wants to merge 1 commit into
rolldown:mainfrom
Cherry:perf/cache-dep-subpath-exports

Conversation

@Cherry

@Cherry Cherry commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

AI usage

  • No AI was used in this PR.
  • AI was used: Claude Opus 5.5
    • I have carefully reviewed the AI-generated content myself.

Description

With deps.resolveDepSubpath turned on, every subpath import reads and parses the dependency's package.json again just to check for exports. We noticed it in one of our builds, which parsed drizzle-orm's 177 KB package.json over 5,000 times.

This caches that check per package.json for the build, and clears it on buildStart so watch rebuilds still pick up changes. On a fixture with 600 files importing subpaths of one big package, our builds went from ~1.75s to ~0.5s, about the same as with the option off.

Added a test that imports subpaths of a package with exports and one without, from a couple of files, to make sure each package still gets its own answer.

@netlify

netlify Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for tsdown-main ready!

Name Link
🔨 Latest commit d9932ed
🔍 Latest deploy log https://app.netlify.com/projects/tsdown-main/deploys/6ac2c5c4ce66790008ef77a3
😎 Deploy Preview https://deploy-preview-1093--tsdown-main.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new

pkg-pr-new Bot commented Oct 4, 2026

Copy link
Copy Markdown

Open in StackBlitz

tsdown

pnpm add https://pkg.pr.new/rolldown/tsdown@1093 -D
npm i https://pkg.pr.new/rolldown/tsdown@1093 -D
yarn add https://pkg.pr.new/rolldown/tsdown@1093.tgz -D

create-tsdown

pnpm add https://pkg.pr.new/rolldown/tsdown/create-tsdown@1093 -D
npm i https://pkg.pr.new/rolldown/tsdown/create-tsdown@1093 -D
yarn add https://pkg.pr.new/rolldown/tsdown/create-tsdown@1093.tgz -D

@tsdown/css

pnpm add https://pkg.pr.new/rolldown/tsdown/@tsdown/css@1093 -D
npm i https://pkg.pr.new/rolldown/tsdown/@tsdown/css@1093 -D
yarn add https://pkg.pr.new/rolldown/tsdown/@tsdown/css@1093.tgz -D

@tsdown/exe

pnpm add https://pkg.pr.new/rolldown/tsdown/@tsdown/exe@1093 -D
npm i https://pkg.pr.new/rolldown/tsdown/@tsdown/exe@1093 -D
yarn add https://pkg.pr.new/rolldown/tsdown/@tsdown/exe@1093.tgz -D

tsdown-migrate

pnpm add https://pkg.pr.new/rolldown/tsdown/tsdown-migrate@1093 -D
npm i https://pkg.pr.new/rolldown/tsdown/tsdown-migrate@1093 -D
yarn add https://pkg.pr.new/rolldown/tsdown/tsdown-migrate@1093.tgz -D

commit: d9932ed

This branch has not been deployed

No deployments
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