forked from tmdh/laravel-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.js
27 lines (27 loc) · 860 Bytes
/
build.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const { buildSync } = require("esbuild");
const { copyFileSync } = require("fs");
const options = {
platform: "node",
bundle: true,
external: ["electron"],
define: {
"process.env.NODE_ENV": `"${process.argv[2] === "--dev" ? "development" : "production"}"`,
"process.platform": `"${process.platform}"`
}
};
buildSync({
entryPoints: ["src/main/main.js"],
outfile: "dist/main.js",
...options
});
console.log("built src/main/main.js -> dist/main.js");
buildSync({
entryPoints: ["src/preload/preload.js"],
outfile: "dist/preload.js",
...options
});
console.log("built src/preload/preload.js -> dist/preload.js");
copyFileSync("src/main/tinker.php", "dist/tinker.php");
console.log("copied src/main/tinker.php -> dist/tinker.php");
copyFileSync("build/icon.png", "dist/icon.png");
console.log("copied build/icon.png -> dist/icon.png");