Skip to content

feat(config): track transitive config dependencies for watch reload#919

Merged
sxzz merged 6 commits intomainfrom
feat/config-deps-tracking
Apr 16, 2026
Merged

feat(config): track transitive config dependencies for watch reload#919
sxzz merged 6 commits intomainfrom
feat/config-deps-tracking

Conversation

@sxzz
Copy link
Copy Markdown
Member

@sxzz sxzz commented Apr 16, 2026

  • This PR contains AI-generated code, but I have carefully reviewed it myself. Otherwise, my PR may be closed.

Description

Replace configFiles: string[] with configDeps: Set<string> and track transitive imports of tsdown.config.ts (and optional Vite config) via import-without-cache's AsyncLocalStorage depsStore and unrun's dependencies output.

Watch mode now triggers a full restart when any imported helper of the config changes, not just the config file itself. Set.has() also replaces Array.includes() for the reload check.

ResolvedConfig.configDeps is exposed as part of the public resolved config shape for downstream consumers.

Linked Issues

Additional context

  • Bumps `import-without-cache` catalog to `^0.3.3` (exposes `depsStore` AsyncLocalStorage).
  • On Node versions without `module.registerHooks` (`!isSupported`) using the `native` loader, transitive deps cannot be tracked; behavior falls back to the pre-refactor root-config-only reload. The `auto` loader already picks `unrun` on those Node versions, which still reports deps.
  • Within a workspace, multiple sub-configs share the same `configDeps` Set reference by design so that Vite-loaded deps propagate to siblings.

sxzz added 2 commits April 16, 2026 17:27
Replace configFiles: string[] with configDeps: Set<string> and track
transitive imports of tsdown.config.ts (and vite config) via
import-without-cache's AsyncLocalStorage depsStore and unrun's
dependencies output. Watch mode now triggers a full restart when any
imported helper of the config changes, not just the config file itself.
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 16, 2026

Deploy Preview for tsdown-main ready!

Name Link
🔨 Latest commit 16bbb6a
🔍 Latest deploy log https://app.netlify.com/projects/tsdown-main/deploys/69e0ba986a33ff0008b5dc81
😎 Deploy Preview https://deploy-preview-919--tsdown-main.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 16, 2026

Open in StackBlitz

tsdown

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

create-tsdown

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

@tsdown/css

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

@tsdown/exe

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

tsdown-migrate

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

commit: 16bbb6a

@sxzz sxzz merged commit 16e2795 into main Apr 16, 2026
15 checks passed
@sxzz sxzz deleted the feat/config-deps-tracking branch April 16, 2026 10:35
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