Skip to content
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

Remove is-builtin-module from rollup #49

Open
43081j opened this issue May 13, 2024 · 0 comments
Open

Remove is-builtin-module from rollup #49

43081j opened this issue May 13, 2024 · 0 comments

Comments

@43081j
Copy link
Owner

43081j commented May 13, 2024

rollup uses is-builtin-module here:
https://github.com/rollup/plugins/blob/9e7f576f33e26d65e9f2221d248a2e000923e03f/packages/node-resolve/src/index.js#L193

it has an engine constraint of >=14 which means we can't use isBuiltin from node itself.

however, we can use builtinModules with a simple string replace:

import {builtinModules} from 'node:module';

const name = '...';
builtinModules.includes(name.replace('node:', ''));
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

No branches or pull requests

1 participant