|
1 |
| -export const On = process.env["NODE_ENV"] === "development" || |
2 |
| - process.env["TAURI_ENV_DEBUG"] === "true"; |
| 1 | +export const On = |
| 2 | + process.env["NODE_ENV"] === "development" || |
| 3 | + process.env["TAURI_ENV_DEBUG"] === "true"; |
3 | 4 | export const Clean = process.env["Clean"] === "true";
|
4 | 5 | /**
|
5 | 6 | * @module ESBuild
|
6 | 7 | *
|
7 | 8 | */
|
8 | 9 | export default {
|
9 |
| - color: true, |
10 |
| - format: "esm", |
11 |
| - logLevel: "debug", |
12 |
| - metafile: true, |
13 |
| - minify: !On, |
14 |
| - outdir: "Configuration", |
15 |
| - platform: "node", |
16 |
| - target: "esnext", |
17 |
| - tsconfig: "tsconfig.json", |
18 |
| - write: true, |
19 |
| - legalComments: On ? "inline" : "none", |
20 |
| - bundle: false, |
21 |
| - assetNames: "Asset/[name]-[hash]", |
22 |
| - sourcemap: On, |
23 |
| - drop: On ? [] : ["debugger"], |
24 |
| - ignoreAnnotations: !On, |
25 |
| - keepNames: On, |
26 |
| - plugins: [ |
27 |
| - { |
28 |
| - name: "Target", |
29 |
| - // @ts-ignore |
30 |
| - setup({ onStart, initialOptions: { outdir } }) { |
31 |
| - switch (true) { |
32 |
| - case Clean === true: |
33 |
| - onStart(async () => { |
34 |
| - try { |
35 |
| - outdir |
36 |
| - ? await (await import("node:fs/promises")).rm(outdir, { |
37 |
| - recursive: true, |
38 |
| - }) |
39 |
| - : {}; |
40 |
| - } |
41 |
| - catch (_Error) { |
42 |
| - console.log(_Error); |
43 |
| - } |
44 |
| - }); |
45 |
| - break; |
46 |
| - default: |
47 |
| - break; |
48 |
| - } |
49 |
| - }, |
50 |
| - }, |
51 |
| - ], |
52 |
| - outbase: "Source/Configuration", |
| 10 | + color: true, |
| 11 | + format: "esm", |
| 12 | + logLevel: "debug", |
| 13 | + metafile: true, |
| 14 | + minify: !On, |
| 15 | + outdir: "Configuration", |
| 16 | + platform: "node", |
| 17 | + target: "esnext", |
| 18 | + tsconfig: "tsconfig.json", |
| 19 | + write: true, |
| 20 | + legalComments: On ? "inline" : "none", |
| 21 | + bundle: false, |
| 22 | + assetNames: "Asset/[name]-[hash]", |
| 23 | + sourcemap: On, |
| 24 | + drop: On ? [] : ["debugger"], |
| 25 | + ignoreAnnotations: !On, |
| 26 | + keepNames: On, |
| 27 | + plugins: [ |
| 28 | + { |
| 29 | + name: "Target", |
| 30 | + // @ts-ignore |
| 31 | + setup({ onStart, initialOptions: { outdir } }) { |
| 32 | + switch (true) { |
| 33 | + case Clean === true: |
| 34 | + onStart(async () => { |
| 35 | + try { |
| 36 | + outdir |
| 37 | + ? await ( |
| 38 | + await import("node:fs/promises") |
| 39 | + ).rm(outdir, { |
| 40 | + recursive: true, |
| 41 | + }) |
| 42 | + : {}; |
| 43 | + } catch (_Error) { |
| 44 | + console.log(_Error); |
| 45 | + } |
| 46 | + }); |
| 47 | + break; |
| 48 | + default: |
| 49 | + break; |
| 50 | + } |
| 51 | + }, |
| 52 | + }, |
| 53 | + ], |
| 54 | + outbase: "Source/Configuration", |
53 | 55 | };
|
54 | 56 | export const { sep, posix } = await import("node:path");
|
0 commit comments