mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-27 03:23:08 +02:00
af2d81a990
* perf: (productionの)dependenciesから@typesを削除、reversi/bubble-gameをesbuildにする * fix * fix
31 lines
649 B
JavaScript
31 lines
649 B
JavaScript
import { build } from "esbuild";
|
|
import { globSync } from "glob";
|
|
|
|
const entryPoints = globSync("./src/**/**.{ts,tsx}");
|
|
|
|
/** @type {import('esbuild').BuildOptions} */
|
|
const options = {
|
|
entryPoints,
|
|
minify: true,
|
|
outdir: "./built/esm",
|
|
target: "es2022",
|
|
platform: "browser",
|
|
format: "esm",
|
|
};
|
|
|
|
if (process.env.WATCH === "true") {
|
|
options.watch = {
|
|
onRebuild(error, result) {
|
|
if (error) {
|
|
console.error("watch build failed:", error);
|
|
} else {
|
|
console.log("watch build succeeded:", result);
|
|
}
|
|
},
|
|
};
|
|
}
|
|
|
|
build(options).catch((err) => {
|
|
process.stderr.write(err.stderr);
|
|
process.exit(1);
|
|
});
|