es-tooling / ecosystem-cleanup

A place to keep track of ongoing efforts to clean up the JS ecosystem
393 stars 2 forks source link

Remove is-builtin-module from rollup #49

Closed 43081j closed 1 month ago

43081j commented 6 months ago

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:', ''));
43081j commented 5 months ago

tracked in rollup/plugins#1735

MichaelDeBoey commented 1 month ago

https://github.com/rollup/plugins/pull/1735 is now merged