mirror of
https://github.com/pomerium/pomerium.git
synced 2025-04-29 18:36:30 +02:00
* core/ui: improve frontend build size * remove luxon * add lodash * remove console.log * only generate sourcemap when watching
28 lines
568 B
TypeScript
28 lines
568 B
TypeScript
/// <reference types="node" />
|
|
import { BuildOptions, build, context } from "esbuild";
|
|
|
|
async function run() {
|
|
const watching = process.argv.includes("--watch");
|
|
|
|
const cfg: BuildOptions = {
|
|
entryPoints: ["src/index.tsx"],
|
|
bundle: true,
|
|
outdir: "dist",
|
|
sourcemap: watching ? "inline" : false,
|
|
minify: !watching,
|
|
logLevel: "info",
|
|
loader: {
|
|
".svg": "dataurl",
|
|
".woff": "dataurl",
|
|
".woff2": "dataurl",
|
|
},
|
|
};
|
|
|
|
if (watching) {
|
|
await (await context(cfg)).watch();
|
|
} else {
|
|
await build(cfg);
|
|
}
|
|
}
|
|
|
|
run();
|