Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
squash!
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaRHristov committed Sep 9, 2023
1 parent a6d65dc commit ade5152
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 49 deletions.
14 changes: 7 additions & 7 deletions Script/Configuration/ESBuild.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
declare const _default: {
format: "esm";
minify: true;
outdir: string;
platform: "node";
target: string;
write: true;
plugins: import("esbuild").Plugin[];
format: "esm";
minify: true;
outdir: string;
platform: "node";
target: string;
write: true;
plugins: import("esbuild").Plugin[];
};
export default _default;
85 changes: 44 additions & 41 deletions Script/Configuration/ESBuild.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,48 @@
import { copy as Copy } from "esbuild-plugin-copy";
import { access as Access, constants as Constant, mkdir as Make, rm as Remove, } from "fs/promises";
import {
access as Access,
constants as Constant,
mkdir as Make,
rm as Remove,
} from "fs/promises";
const Out = "Target";
export default {
format: "esm",
minify: true,
outdir: Out,
platform: "node",
target: "esnext",
write: true,
plugins: [
{
name: "Target",
setup(Build) {
Build.onStart(async () => {
try {
await Access(Out, Constant.R_OK);
}
catch (_Error) {
await Make(Out, {
recursive: true,
});
}
try {
await Remove(Out, {
recursive: true,
});
}
catch (_Error) {
console.log(_Error);
}
});
},
},
Copy({
resolveFrom: "out",
assets: [
{
from: "./Source/Workflow/*.yml",
to: "./Workflow/",
},
],
}),
],
format: "esm",
minify: true,
outdir: Out,
platform: "node",
target: "esnext",
write: true,
plugins: [
{
name: "Target",
setup(Build) {
Build.onStart(async () => {
try {
await Access(Out, Constant.R_OK);
} catch (_Error) {
await Make(Out, {
recursive: true,
});
}
try {
await Remove(Out, {
recursive: true,
});
} catch (_Error) {
console.log(_Error);
}
});
},
},
Copy({
resolveFrom: "out",
assets: [
{
from: "./Source/Workflow/*.yml",
to: "./Workflow/",
},
],
}),
],
};
2 changes: 1 addition & 1 deletion Script/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"lib": ["ESNext", "DOM"],
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"outDir": "Target"
},
"extends": "typescript-esbuild/Target/Configuration/TypeScript",
Expand Down

0 comments on commit ade5152

Please sign in to comment.