Files
Betriebsf-hrungssoftware/scripts/build-web.mjs

17 lines
508 B
JavaScript

import { build } from "esbuild";
import { cp, mkdir } from "node:fs/promises";
await mkdir("dist/web", { recursive: true });
await build({
entryPoints: ["src/web/app.ts"],
bundle: true,
format: "esm",
target: "es2022",
outfile: "dist/web/app.js",
sourcemap: true,
minify: process.env.NODE_ENV === "production",
});
await cp("src/web/index.html", "dist/web/index.html");
await cp("src/web/styles.css", "dist/web/styles.css");
await cp("src/web/bilder", "dist/web/bilder", { recursive: true });