fix(node-protocol): respect alias and tsconfig paths when stripping node: prefix#773
Open
lazuee wants to merge 3 commits intorolldown:mainfrom
Open
fix(node-protocol): respect alias and tsconfig paths when stripping node: prefix#773lazuee wants to merge 3 commits intorolldown:mainfrom
lazuee wants to merge 3 commits intorolldown:mainfrom
Conversation
✅ Deploy Preview for tsdown-main ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
tsdown
create-tsdown
tsdown-migrate
commit: |
sxzz
approved these changes
Feb 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When
nodeProtocol: "strip"is configured, theNodeProtocolPluginruns withorder: 'pre'and immediately marks strippednode:imports asexternal: true. This short-circuits the entire resolution chain, soaliasand tsconfigpathsconfigurations that map the stripped module name (e.g.,crypto) to a polyfill are never consulted.The fix changes the
striphandler to callthis.resolve()with the stripped ID before marking it as external. If another resolver (alias, tsconfig paths) resolves it to a non-external module, that resolution is used instead.Linked Issues
Fixes #772
Additional context
The test covers both resolution methods in a single case:
alias:node:path→ stripped topath→ resolved viaaliasto a polyfilltsconfig paths:node:crypto→ stripped tocrypto→ resolved viapathsto a polyfill