mirror of
https://github.com/hotomoe/hotomoe
synced 2024-12-12 13:48:12 +09:00
2a851437ff
* fix: ビルドが遅いパッケージのビルド速度を改善 * dependenciesの整理 * fix ci * ビルド開始時に古いファイルを消す * fix ci * fix ci
32 lines
649 B
JavaScript
32 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);
|
|
});
|