Fix: build async bug

This commit is contained in:
xiangyu 2022-08-24 19:17:00 +08:00
parent fdbf369454
commit 8bad0cffff

View File

@ -83,6 +83,7 @@ function dateFormat(fmt, date) {
return fmt; return fmt;
} }
async function main() {
const t = new Date(); const t = new Date();
const buildTime = dateFormat("YYYY-mm-dd HH:MM:SS", t); const buildTime = dateFormat("YYYY-mm-dd HH:MM:SS", t);
const buildDir = "builds"; const buildDir = "builds";
@ -95,7 +96,7 @@ clearFolder(buildDir);
copyFolderRecursiveSync("addon", buildDir); copyFolderRecursiveSync("addon", buildDir);
esbuild await esbuild
.build({ .build({
entryPoints: ["src/index.ts"], entryPoints: ["src/index.ts"],
bundle: true, bundle: true,
@ -169,3 +170,6 @@ console.log("[Build] Addon pack OK");
console.log( console.log(
`[Build] Finished in ${(new Date().getTime() - t.getTime()) / 1000} s.` `[Build] Finished in ${(new Date().getTime() - t.getTime()) / 1000} s.`
); );
}
main();