This repository has been archived by the owner on Apr 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a6d65dc
commit ade5152
Showing
3 changed files
with
52 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/", | ||
}, | ||
], | ||
}), | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters