Skip to content

Commit c116478

Browse files
committed
rely on node builtinModules instead of maintaining a list manually
1 parent b67626c commit c116478

1 file changed

Lines changed: 3 additions & 50 deletions

File tree

lib/node/NodeTargetPlugin.js

Lines changed: 3 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -5,61 +5,14 @@
55

66
"use strict";
77

8+
const { builtinModules } = require("module");
89
const ExternalsPlugin = require("../ExternalsPlugin");
910

1011
/** @typedef {import("../Compiler")} Compiler */
1112

1213
const builtins = [
13-
"assert",
14-
"async_hooks",
15-
"buffer",
16-
"child_process",
17-
"cluster",
18-
"console",
19-
"constants",
20-
"crypto",
21-
"dgram",
22-
"diagnostics_channel",
23-
"dns",
24-
"dns/promises",
25-
"domain",
26-
"events",
27-
"fs",
28-
"fs/promises",
29-
"http",
30-
"http2",
31-
"https",
32-
"inspector",
33-
"module",
34-
"net",
35-
"os",
36-
"path",
37-
"path/posix",
38-
"path/win32",
39-
"perf_hooks",
40-
"process",
41-
"punycode",
42-
"querystring",
43-
"readline",
44-
"repl",
45-
"stream",
46-
"stream/promises",
47-
"stream/web",
48-
"string_decoder",
49-
"sys",
50-
"timers",
51-
"timers/promises",
52-
"tls",
53-
"trace_events",
54-
"tty",
55-
"url",
56-
"util",
57-
"util/types",
58-
"v8",
59-
"vm",
60-
"wasi",
61-
"worker_threads",
62-
"zlib",
14+
...builtinModules,
15+
6316
/^node:/,
6417

6518
// cspell:word pnpapi

0 commit comments

Comments
 (0)