From bd181d308b57971750874fc772f371245588cce6 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sun, 15 Oct 2023 07:05:36 +0300 Subject: [PATCH] squash! --- Configuration/ESBuild.d.ts | 3 +++ Configuration/ESBuild.js | 42 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 Configuration/ESBuild.d.ts create mode 100644 Configuration/ESBuild.js diff --git a/Configuration/ESBuild.d.ts b/Configuration/ESBuild.d.ts new file mode 100644 index 0000000..354eaf5 --- /dev/null +++ b/Configuration/ESBuild.d.ts @@ -0,0 +1,3 @@ +declare const _default: BuildOptions; +export default _default; +import type { BuildOptions } from "esbuild"; diff --git a/Configuration/ESBuild.js b/Configuration/ESBuild.js new file mode 100644 index 0000000..6202eb7 --- /dev/null +++ b/Configuration/ESBuild.js @@ -0,0 +1,42 @@ +export default { + color: true, + format: "esm", + metafile: true, + minify: true, + outdir: "Target", + platform: "node", + target: "esnext", + write: true, + logLevel: "debug", + plugins: [ + { + name: "Target", + setup({ onStart, initialOptions: { outdir } }) { + onStart(async () => { + try { + outdir + ? await (await import("fs/promises")).rm(outdir, { + recursive: true, + }) + : {}; + } + catch (_Error) { + console.log(_Error); + } + }); + }, + }, + (await import("esbuild-plugin-copy")).copy({ + resolveFrom: "out", + assets: [ + { + from: "./Source/Notation/biome.json", + to: "./Notation/", + }, + ], + }), + ], + define: { + "process.env.VERSION_PACKAGE": `'${(await (await import("typescript-esbuild/Target/Function/JSON.js")).default("package.json"))?.version}'`, + }, +};