adrift/server/esbuild.bundle.js
2023-08-16 21:10:37 -04:00

19 lines
No EOL
586 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,
outfile: "dist/main.js",
plugins: [
makeAllPackagesExternalPlugin
],
})