|
1 | | -var __defProp = Object.defineProperty; |
2 | | -var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); |
3 | | -import { deepmerge } from "deepmerge-ts"; |
4 | | -import * as Environment from "../Constant/EnvironmentConstant.js"; |
5 | | -import BaseConfig from "./BaseConfig.js"; |
6 | | -const PostHogDefines = { |
7 | | - "import.meta.env.Authorize": JSON.stringify(process.env["Authorize"] ?? ""), |
8 | | - "import.meta.env.Beam": JSON.stringify( |
9 | | - process.env["Beam"] ?? "https://eu.i.posthog.com" |
10 | | - ), |
11 | | - "import.meta.env.Report": JSON.stringify(process.env["Report"] ?? "true"), |
12 | | - "import.meta.env.Replay": JSON.stringify(process.env["Replay"] ?? "false"), |
13 | | - "import.meta.env.Ask": JSON.stringify(process.env["Ask"] ?? "false"), |
14 | | - "import.meta.env.Brand": JSON.stringify(process.env["Brand"] ?? "") |
| 1 | +import { deepmerge as n } from "deepmerge-ts"; |
| 2 | + |
| 3 | +import * as e from "../Constant/EnvironmentConstant.js"; |
| 4 | +import p from "./BaseConfig.js"; |
| 5 | + |
| 6 | +const a = { |
| 7 | + "import.meta.env.Authorize": JSON.stringify(process.env.Authorize ?? ""), |
| 8 | + "import.meta.env.Beam": JSON.stringify( |
| 9 | + process.env.Beam ?? "https://eu.i.posthog.com", |
| 10 | + ), |
| 11 | + "import.meta.env.Report": JSON.stringify(process.env.Report ?? "true"), |
| 12 | + "import.meta.env.Replay": JSON.stringify(process.env.Replay ?? "false"), |
| 13 | + "import.meta.env.Ask": JSON.stringify(process.env.Ask ?? "false"), |
| 14 | + "import.meta.env.Brand": JSON.stringify(process.env.Brand ?? ""), |
15 | 15 | }; |
16 | | -async function targetConfig(Current) { |
17 | | - const merged = deepmerge(BaseConfig, { |
18 | | - outdir: "Target", |
19 | | - drop: Environment.On ? [] : ["debugger", "console"], |
20 | | - define: { |
21 | | - __DEV__: Environment.On ? "true" : "false", |
22 | | - __INCREMENT__: `"${`${Environment.On ? "DEVELOPMENT" : "PRODUCTION"}-${(await import("ulid")).ulid()}`}"`, |
23 | | - ...PostHogDefines |
24 | | - }, |
25 | | - treeShaking: !Environment.On, |
26 | | - entryPoints: (await import("@playform/build/Target/Function/Entry.js")).default(Current, ["Source/Configuration/*"]), |
27 | | - platform: "browser", |
28 | | - outbase: "Source", |
29 | | - plugins: Environment.Compile ? deepmerge(Current.plugins || [], [ |
30 | | - { |
31 | | - name: "Compile", |
32 | | - setup({ onEnd }) { |
33 | | - onEnd(async ({ metafile }) => { |
34 | | - const _Output = metafile?.outputs; |
35 | | - for (const Output in _Output) { |
36 | | - if (Object.prototype.hasOwnProperty.call( |
37 | | - _Output, |
38 | | - Output |
39 | | - )) { |
40 | | - if (Output.endsWith(".js")) { |
41 | | - (await import("@playform/build/Target/Function/Exec.js")).default( |
42 | | - `Build '${Output}' --ESBuild Configuration/ESBuild/Target/Compile.js --TypeScript Configuration/tsconfig/Target/Compile.json` |
43 | | - ); |
44 | | - } |
45 | | - } |
46 | | - } |
47 | | - }); |
48 | | - } |
49 | | - } |
50 | | - ]) : [] |
51 | | - }); |
52 | | - return merged; |
| 16 | +async function m(o) { |
| 17 | + return n(p, { |
| 18 | + outdir: "Target", |
| 19 | + drop: e.On ? [] : ["debugger", "console"], |
| 20 | + define: { |
| 21 | + __DEV__: e.On ? "true" : "false", |
| 22 | + __INCREMENT__: `"${`${e.On ? "DEVELOPMENT" : "PRODUCTION"}-${(await import("ulid")).ulid()}`}"`, |
| 23 | + ...a, |
| 24 | + }, |
| 25 | + treeShaking: !e.On, |
| 26 | + entryPoints: ( |
| 27 | + await import("@playform/build/Target/Function/Entry.js") |
| 28 | + ).default(o, ["Source/Configuration/*"]), |
| 29 | + platform: "browser", |
| 30 | + outbase: "Source", |
| 31 | + plugins: e.Compile |
| 32 | + ? n(o.plugins || [], [ |
| 33 | + { |
| 34 | + name: "Compile", |
| 35 | + setup({ onEnd: r }) { |
| 36 | + r(async ({ metafile: s }) => { |
| 37 | + const i = s?.outputs; |
| 38 | + for (const t in i) |
| 39 | + Object.prototype.hasOwnProperty.call( |
| 40 | + i, |
| 41 | + t, |
| 42 | + ) && |
| 43 | + t.endsWith(".js") && |
| 44 | + ( |
| 45 | + await import("@playform/build/Target/Function/Exec.js") |
| 46 | + ).default( |
| 47 | + `Build '${t}' --ESBuild Configuration/ESBuild/Target/Compile.js --TypeScript Configuration/tsconfig/Target/Compile.json`, |
| 48 | + ); |
| 49 | + }); |
| 50 | + }, |
| 51 | + }, |
| 52 | + ]) |
| 53 | + : [], |
| 54 | + }); |
53 | 55 | } |
54 | | -__name(targetConfig, "targetConfig"); |
55 | | -export { |
56 | | - targetConfig as default |
57 | | -}; |
58 | | -//# sourceMappingURL=TargetConfig.js.map |
| 56 | +export { m as default }; |
0 commit comments