adrift/server/esbuild.bundle.js
CoolElectronics 30bf6cb8f1
pkg fixes
2023-08-22 21:14:41 -04:00

31 lines
No EOL
811 B
JavaScript

let makeAllPackagesExternalPlugin = {
name: 'make-all-packages-external',
setup(build) {
let filter = /^[^.\/]|^\.[^.\/]|^\.\.[^\/]/ // Must not start with "/" or "./" or "../"
let ignored = ["wrtc"]
build.onResolve({ filter }, args => (ignored.includes(args.path) ? { path: args.path, external: true } : null))
},
}
const { build } = require('esbuild');
build({
entryPoints: ["src/main.ts"],
platform: "node",
// format: "esm",
bundle: true,
minify: true,
outfile: "dist/main.js",
plugins: [
makeAllPackagesExternalPlugin
],
})
build({
entryPoints: ["src/autoupdater.ts"],
platform: "node",
bundle: true,
minify: true,
outfile: "dist/autoupdater.js",
plugins: [
makeAllPackagesExternalPlugin
],
})