We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8c21430 commit b015747Copy full SHA for b015747
doc/api/esm.md
@@ -147,15 +147,13 @@ be written:
147
import url from 'url';
148
import path from 'path';
149
import process from 'process';
150
+import Module from 'module';
151
-const builtins = new Set(
152
- Object.keys(process.binding('natives')).filter((str) =>
153
- /^(?!(?:internal|node|v8)\/)/.test(str))
154
-);
+const builtins = Module.builtinModules;
155
const JS_EXTENSIONS = new Set(['.js', '.mjs']);
156
157
export function resolve(specifier, parentModuleURL/*, defaultResolve */) {
158
- if (builtins.has(specifier)) {
+ if (builtins.includes(specifier)) {
159
return {
160
url: specifier,
161
format: 'builtin'
0 commit comments