这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@aryaemami59
Copy link
Contributor

This PR:

  • Fixes removeNodeProtocol to work with shims.

@codesandbox
Copy link

codesandbox bot commented Oct 27, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@vercel
Copy link

vercel bot commented Oct 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tsup ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 27, 2025 4:33am

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 27, 2024

Open in Stackblitz

npm i https://pkg.pr.new/egoist/tsup@1242

commit: 924e375

@sxzz
Copy link
Collaborator

sxzz commented Nov 1, 2024

removeNodeProtocol is designed for Node compatibility, but if the version supports ESM, the node protocol is natively supported and doesn't need to be removed.

@sxzz
Copy link
Collaborator

sxzz commented Nov 1, 2024

According to the documentation, the node: protocol is supported in CJS starting from versions v16.0.0 and v14.18.0, and in ESM from versions v14.13.1 and v12.20.0.

Do you think it's necessary to support v12.0.0 >= node < v12.20.0

@aryaemami59
Copy link
Contributor Author

aryaemami59 commented Nov 2, 2024

@sxzz I see what you're saying, I guess the point of the PR is to make removeNodeProtocol apply to shims as well for consistency. Thoughts?

Copy link
Collaborator

@sxzz sxzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for the rest part

@aryaemami59
Copy link
Contributor Author

@sxzz I have made the requested adjustments.

@sxzz sxzz merged commit 769aa49 into egoist:main Feb 27, 2025
12 checks passed
@aryaemami59 aryaemami59 deleted the fix/removeNodeProtocol-for-shims branch February 27, 2025 06:56
@humphd
Copy link

humphd commented Jun 1, 2025

This change broke my library such that it no longer worked in Deno, e.g:

error: Relative import path "util" not prefixed with / or ./ or ../
  hint: If you want to use a built-in Node module, add a "node:" prefix (ex. "node:util").

Adding removeNodeProtocol: false to the ESM config solved it. I wonder if it would be worth calling this out in the docs for others?

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.

4 participants