/ examples / basic-auth / esbuild.js
esbuild.js
 1  const { build } = require("esbuild");
 2  const define = {};
 3  
 4  for (const k in process.env) {
 5    define[`process.env.${k}`] = JSON.stringify(process.env[k]);
 6  }
 7  
 8  if (!process.env["CODEX_NODE_URL"]) {
 9    define[`process.env.CODEX_NODE_URL`] = '"http://localhost:8080"';
10  }
11  
12  const options = {
13    entryPoints: ["./index.js"],
14    outfile: "./index.bundle.js",
15    bundle: true,
16    define,
17    logOverride: {
18      "ignored-bare-import": "silent",
19    },
20  };
21  
22  build(options).catch(() => process.exit(1));