min-robot/build.mjs

25 lines
550 B
JavaScript
Raw Permalink Normal View History

2025-01-12 13:56:55 -06:00
import esbuild from "esbuild";
/**
* @type {esbuild.Plugin}
*/
const makeAllPackagesExternalPlugin = {
name: "make-all-packages-external",
setup(build) {
const filter = /^[^./|~]|^\.[^./]|^\.\.[^/]/; // Must not start with "/" or "./" or "../"
build.onResolve({ filter }, (args) => ({
path: args.path,
external: true,
}));
},
};
await esbuild.build({
entryPoints: ["src/index.ts"],
bundle: true,
outfile: "dist/index.js",
platform: "node",
target: "esnext",
plugins: [makeAllPackagesExternalPlugin],
});