-
Notifications
You must be signed in to change notification settings - Fork 991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use node:
prefix for node imports.
#2358
Comments
Looks like updating https://github.com/yargs/yargs/blob/e0823dd7e6ced7eaf1d7d1e67f77374f4ef5cbce/lib/platform-shims/esm.mjs is pretty trivial (and similar for CJS, although I don't need that myself), but the
https://rollupjs.org/configuration-options/ includes |
The error might be a dependency problem rather than |
When bundling a program that uses
yargs
, the bundler needs to know whether to include certain dependencies. In particular,node
dependencies should be excluded.Unfortunately,
yargs
does not currently use thenode:
prefix, which means:npm
packages with the same name (often polyfills that a coder may or may not want to include for separate reasons).Many bundlers also support wildcards for ignores: for example, you can set
node:*
as external packages inesbuild
.So using a
node:
prefix for all imports ofnode
modules would make it simpler and safer to produce correct bundled code when usingyargs
.This is available for ESM back to node
12
, matching the compatibility defined here: https://github.com/yargs/yargs/blob/main/package.json#L125The text was updated successfully, but these errors were encountered: