mirror of
https://github.com/MercuryWorkshop/adrift.git
synced 2025-05-12 13:50:01 -04:00
19 lines
No EOL
586 B
JavaScript
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
|
|
],
|
|
}) |