perf: (productionの)dependenciesから@typesを削除、reversi/bubble-gameをesbuildにする (#13067)

* perf: (productionの)dependenciesから@typesを削除、reversi/bubble-gameをesbuildにする

* fix

* fix
This commit is contained in:
tamaina
2024-01-23 06:36:44 +09:00
committed by GitHub
parent 58ac8bc8e9
commit af2d81a990
7 changed files with 104 additions and 27 deletions

View File

@@ -0,0 +1,31 @@
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);
});