const esbuild = require("esbuild");
const { nodeExternalsPlugin } = require("esbuild-node-externals");

// Clean the output directory

esbuild
  .build({
    entryPoints: ["src/index.ts"],
    outdir: "build",
    bundle: true,
    sourcemap: true,
    minify: true,
    splitting: false,
    treeShaking: true,
    platform: 'neutral',
    format: 'cjs',
    target: 'es2015',
    plugins: [nodeExternalsPlugin()],
  })
  .catch(() => process.exit(1));
