This commit is contained in:
Rizky 2024-07-24 19:54:16 +07:00
parent 8dbd4fa8c5
commit 508d16ef2c
2 changed files with 55 additions and 1 deletions

View File

@ -25,7 +25,6 @@ const ctx = await context({
define: { define: {
"process.env.NODE_ENV": `"production"`, "process.env.NODE_ENV": `"production"`,
}, },
plugins: [ plugins: [
polyfillNode({ polyfillNode({
polyfills: { polyfills: {

View File

@ -12,6 +12,7 @@ import {
removeAsync, removeAsync,
writeAsync, writeAsync,
} from "fs-jetpack"; } from "fs-jetpack";
import { polyfillNode } from "esbuild-plugin-polyfill-node";
import { platform } from "os"; import { platform } from "os";
const brotli = await brotliPromise; const brotli = await brotliPromise;
@ -32,6 +33,60 @@ await build({
define: { define: {
"process.env.NODE_ENV": `"production"`, "process.env.NODE_ENV": `"production"`,
}, },
plugins: [
polyfillNode({
polyfills: {
buffer: true,
_stream_duplex: false,
_stream_passthrough: false,
_stream_readable: false,
_stream_transform: false,
_stream_writable: false,
assert: false,
async_hooks: false,
child_process: false,
cluster: false,
console: false,
constants: false,
crypto: false,
dgram: false,
diagnostics_channel: false,
dns: false,
domain: false,
events: false,
fs: false,
http: false,
http2: false,
https: false,
module: false,
net: false,
os: false,
path: false,
perf_hooks: false,
process: false,
punycode: false,
querystring: false,
readline: false,
repl: false,
stream: false,
string_decoder: false,
sys: false,
timers: false,
tls: false,
tty: false,
url: false,
util: false,
v8: false,
vm: false,
wasi: false,
worker_threads: false,
zlib: false,
"assert/strict": false,
"fs/promises": false,
"timers/promises": false,
},
}),
],
}); });
const build_all = const build_all =