Skip to content

fix: throw error when skipNodeModulesBundle and noExternal are used together#746

Merged
sxzz merged 1 commit intomainfrom
fix/conflict-skipNodeModulesBundle-noExternal
Feb 1, 2026
Merged

fix: throw error when skipNodeModulesBundle and noExternal are used together#746
sxzz merged 1 commit intomainfrom
fix/conflict-skipNodeModulesBundle-noExternal

Conversation

@sxzz
Copy link
Member

@sxzz sxzz commented Feb 1, 2026

Summary

  • Throw a TypeError when skipNodeModulesBundle and noExternal are both configured, as they are mutually exclusive options

Context

skipNodeModulesBundle means "do not bundle any dependencies from node_modules", while noExternal means "force certain dependencies to be bundled". Using them together leads to ambiguous behavior where transitive dependencies of noExternal packages are still externalized by skipNodeModulesBundle.

Closes #741

…ogether

These two options are mutually exclusive: skipNodeModulesBundle means
"do not bundle any node_modules", while noExternal means "force certain
dependencies to be bundled". Using them together leads to ambiguous
behavior where transitive dependencies of noExternal packages are
still externalized.

Closes #741
@netlify
Copy link

netlify bot commented Feb 1, 2026

Deploy Preview for tsdown ready!

Name Link
🔨 Latest commit dca9a63
🔍 Latest deploy log https://app.netlify.com/projects/tsdown/deploys/697f540b4f60c700088898cd
😎 Deploy Preview https://deploy-preview-746--tsdown.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

pkg-pr-new bot commented Feb 1, 2026

Open in StackBlitz

npm i https://pkg.pr.new/tsdown@746
npm i https://pkg.pr.new/create-tsdown@746
npm i https://pkg.pr.new/tsdown-migrate@746

commit: dca9a63

@sxzz sxzz enabled auto-merge (squash) February 1, 2026 13:25
@sxzz sxzz disabled auto-merge February 1, 2026 13:25
@sxzz sxzz merged commit 656d519 into main Feb 1, 2026
17 checks passed
@sxzz sxzz deleted the fix/conflict-skipNodeModulesBundle-noExternal branch February 1, 2026 13:25
@dackmin
Copy link

dackmin commented Feb 10, 2026

Hey, I think this change is kind of breaking!
I was under the assumption that it meant "skip any dependency EXCEPT these ones" and it worked perfectly until this PR.
Do we have any replacement to achieve this? inlineOnly doesn't seem to do anything when skipNodeModulesBundle is enabled either, and putting all the dependencies in external does not include transitive dependencies and breaks the build altogether.
Thanks!

@sxzz
Copy link
Member Author

sxzz commented Feb 10, 2026

@dackmin Please open a new issue describing the problem you encountered in detail, and provide a minimal reproduction.

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.

When skipNodeModulesBundle and iife format, transitive dependencies in noExternal list is not be included

2 participants