Last change
on this file since 6c1585f was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | /*
|
---|
2 | MIT License http://www.opensource.org/licenses/mit-license.php
|
---|
3 | Author Tobias Koppers @sokra
|
---|
4 | */
|
---|
5 |
|
---|
6 | "use strict";
|
---|
7 |
|
---|
8 | const ExternalsPlugin = require("../ExternalsPlugin");
|
---|
9 |
|
---|
10 | /** @typedef {import("../Compiler")} Compiler */
|
---|
11 |
|
---|
12 | const builtins = [
|
---|
13 | "assert",
|
---|
14 | "async_hooks",
|
---|
15 | "buffer",
|
---|
16 | "child_process",
|
---|
17 | "cluster",
|
---|
18 | "console",
|
---|
19 | "constants",
|
---|
20 | "crypto",
|
---|
21 | "dgram",
|
---|
22 | "dns",
|
---|
23 | "dns/promises",
|
---|
24 | "domain",
|
---|
25 | "events",
|
---|
26 | "fs",
|
---|
27 | "fs/promises",
|
---|
28 | "http",
|
---|
29 | "http2",
|
---|
30 | "https",
|
---|
31 | "inspector",
|
---|
32 | "module",
|
---|
33 | "net",
|
---|
34 | "os",
|
---|
35 | "path",
|
---|
36 | "perf_hooks",
|
---|
37 | "process",
|
---|
38 | "punycode",
|
---|
39 | "querystring",
|
---|
40 | "readline",
|
---|
41 | "repl",
|
---|
42 | "stream",
|
---|
43 | "stream/promises",
|
---|
44 | "string_decoder",
|
---|
45 | "sys",
|
---|
46 | "timers",
|
---|
47 | "timers/promises",
|
---|
48 | "tls",
|
---|
49 | "trace_events",
|
---|
50 | "tty",
|
---|
51 | "url",
|
---|
52 | "util",
|
---|
53 | "v8",
|
---|
54 | "vm",
|
---|
55 | "wasi",
|
---|
56 | "worker_threads",
|
---|
57 | "zlib",
|
---|
58 | /^node:/,
|
---|
59 |
|
---|
60 | // cspell:word pnpapi
|
---|
61 | // Yarn PnP adds pnpapi as "builtin"
|
---|
62 | "pnpapi"
|
---|
63 | ];
|
---|
64 |
|
---|
65 | class NodeTargetPlugin {
|
---|
66 | /**
|
---|
67 | * Apply the plugin
|
---|
68 | * @param {Compiler} compiler the compiler instance
|
---|
69 | * @returns {void}
|
---|
70 | */
|
---|
71 | apply(compiler) {
|
---|
72 | new ExternalsPlugin("node-commonjs", builtins).apply(compiler);
|
---|
73 | }
|
---|
74 | }
|
---|
75 |
|
---|
76 | module.exports = NodeTargetPlugin;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.