Skip to content

Commit de68fb0

Browse files
committed
rewrite
1 parent 473f4ba commit de68fb0

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

build/build.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,14 @@ const BUILD_OPTIONS: ESBuild.BuildOptions = {
99
minify: true,
1010
define: { LIVE_RELOAD: "false" },
1111
};
12-
async function main(): Promise<void> {
12+
if (import.meta.main) {
1313
const start = performance.now();
14-
if (!await Dictionary.build()) {
14+
if (await Dictionary.build()) {
15+
await ESBuild.build(BUILD_OPTIONS);
16+
const end = performance.now();
17+
// deno-lint-ignore no-console
18+
console.log(`Total time took: ${Math.floor(end - start)}ms`);
19+
} else {
1520
Deno.exitCode = 1;
16-
return;
1721
}
18-
await ESBuild.build(BUILD_OPTIONS);
19-
const end = performance.now();
20-
// deno-lint-ignore no-console
21-
console.log(`Total time took: ${Math.floor(end - start)}ms`);
22-
}
23-
if (import.meta.main) {
24-
await main();
2522
}

0 commit comments

Comments
 (0)