Skip to content

Commit 9451257

Browse files
style(Output): Reformat ESBuild configuration with consistent style
Apply consistent code formatting across ESBuild/Output.js: add blank line after import statements, reformat multi-line expressions with proper indentation, and adjust nested await parentheses in the Clean function handler. Also exports the Clean flag variable for external consumption. No functional changes to the build configuration itself.
1 parent f14de1d commit 9451257

File tree

1 file changed

+54
-51
lines changed

1 file changed

+54
-51
lines changed

Source/ESBuild/Output.js

Lines changed: 54 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,64 @@
11
import { createRestPluginIfEnabled } from "./RestPlugin.js";
2+
23
export const Clean = process.env["Clean"] === "true";
34
export const Meta = process.env["Meta"] === "true";
4-
export const On = process.env["NODE_ENV"] === "development" ||
5-
process.env["TAURI_ENV_DEBUG"] === "true";
5+
export const On =
6+
process.env["NODE_ENV"] === "development" ||
7+
process.env["TAURI_ENV_DEBUG"] === "true";
68
/**
79
* @module ESBuild
810
*
911
*/
1012
export default {
11-
color: true,
12-
format: "esm",
13-
logLevel: On ? "debug" : "silent",
14-
metafile: Meta,
15-
minify: !On,
16-
outdir: "Configuration",
17-
platform: "node",
18-
target: "esnext",
19-
tsconfig: "tsconfig.json",
20-
write: true,
21-
legalComments: On ? "inline" : "none",
22-
bundle: false,
23-
assetNames: "Asset/[name]-[hash]",
24-
sourcemap: On,
25-
drop: On ? [] : ["debugger"],
26-
ignoreAnnotations: !On,
27-
keepNames: On,
28-
plugins: [
29-
{
30-
name: "Target",
31-
// @ts-ignore
32-
setup({ onStart, initialOptions: { outdir } }) {
33-
switch (true) {
34-
case Clean === true:
35-
onStart(async () => {
36-
try {
37-
outdir
38-
? await (await import("node:fs/promises")).rm(outdir, {
39-
recursive: true,
40-
})
41-
: {};
42-
}
43-
catch (_Error) {
44-
console.log(_Error);
45-
}
46-
});
47-
break;
48-
default:
49-
break;
50-
}
51-
},
52-
},
53-
// Conditionally add Rest plugin when Compiler=Rest
54-
...(createRestPluginIfEnabled() ? [createRestPluginIfEnabled()] : []),
55-
].filter((plugin) => plugin !== null),
56-
loader: {
57-
".json": "copy",
58-
".sh": "copy",
59-
},
13+
color: true,
14+
format: "esm",
15+
logLevel: On ? "debug" : "silent",
16+
metafile: Meta,
17+
minify: !On,
18+
outdir: "Configuration",
19+
platform: "node",
20+
target: "esnext",
21+
tsconfig: "tsconfig.json",
22+
write: true,
23+
legalComments: On ? "inline" : "none",
24+
bundle: false,
25+
assetNames: "Asset/[name]-[hash]",
26+
sourcemap: On,
27+
drop: On ? [] : ["debugger"],
28+
ignoreAnnotations: !On,
29+
keepNames: On,
30+
plugins: [
31+
{
32+
name: "Target",
33+
// @ts-ignore
34+
setup({ onStart, initialOptions: { outdir } }) {
35+
switch (true) {
36+
case Clean === true:
37+
onStart(async () => {
38+
try {
39+
outdir
40+
? await (
41+
await import("node:fs/promises")
42+
).rm(outdir, {
43+
recursive: true,
44+
})
45+
: {};
46+
} catch (_Error) {
47+
console.log(_Error);
48+
}
49+
});
50+
break;
51+
default:
52+
break;
53+
}
54+
},
55+
},
56+
// Conditionally add Rest plugin when Compiler=Rest
57+
...(createRestPluginIfEnabled() ? [createRestPluginIfEnabled()] : []),
58+
].filter((plugin) => plugin !== null),
59+
loader: {
60+
".json": "copy",
61+
".sh": "copy",
62+
},
6063
};
6164
export const { sep, posix } = await import("node:path");

0 commit comments

Comments
 (0)