diff --git a/Source/Function/Build.ts b/Source/Function/Build.ts index bd564a9..8129594 100644 --- a/Source/Function/Build.ts +++ b/Source/Function/Build.ts @@ -10,13 +10,17 @@ export default (async (...[File, Option]: Parameters) => { for (const _File of File) { for (const __File of await ( await import("fast-glob") - ).default(_File.replaceAll("'", "").replaceAll('"', ""))) { + ).default(_File.replaceAll("'", "").replaceAll('"', ""), { + ignore: Option?.Exclude ?? [], + })) { Pipe.push(__File); } } Pipe.reverse(); + console.log(Pipe); + let Configuration: BuildOptions = Merge( (await import("../Variable/ESBuild.js")).default, { @@ -30,18 +34,20 @@ export default (async (...[File, Option]: Parameters) => { File, ]), ), - tsconfig: Option?.TypeScript ?? "tsconfig.json", }, ); - Configuration = Option?.ESBuild + + Configuration = Merge(Option?.ESBuild ? Merge( Configuration, await ( await import("@Function/File.js") ).default(Option.ESBuild), ) - : Configuration; + : Configuration, { + tsconfig: Option?.TypeScript ?? "tsconfig.json", + }); Configuration.plugins?.push({ name: "TypeScript", diff --git a/Source/Interface/Build.ts b/Source/Interface/Build.ts index e32d153..87ce4a5 100644 --- a/Source/Interface/Build.ts +++ b/Source/Interface/Build.ts @@ -21,6 +21,7 @@ export default interface Interface { ESBuild?: string; TypeScript?: string; Watch?: boolean; + Exclude?: Pattern[]; }, ): Promise; } diff --git a/Target/Function/Build.js b/Target/Function/Build.js index d8b3849..00684be 100644 --- a/Target/Function/Build.js +++ b/Target/Function/Build.js @@ -1 +1 @@ -var l=async(...[s,e])=>{for(const a of s)for(const p of await(await import("fast-glob")).default(a.replaceAll("'","").replaceAll('"',"")))i.push(p);i.reverse();let t=o((await import("../Variable/ESBuild.js")).default,{entryPoints:Object.fromEntries(i.map(a=>[a.replace("Source/","").replace("src/","").split(".").slice(0,-1).join("."),a])),tsconfig:e?.TypeScript??"tsconfig.json"});t=e?.ESBuild?o(t,await(await import("./File.js")).default(e.ESBuild)):t,t.plugins?.push({name:"TypeScript",setup({onEnd:a}){a(async()=>{await r(`tsc -p ${t.tsconfig}`),await r(`tsc-alias -f -p ${t.tsconfig}`)})}}),e?.Watch?await(await(await import("esbuild")).context(t)).watch():console.log(await(await import("esbuild")).analyzeMetafile((await(await import("esbuild")).build(t))?.metafile??"",{verbose:!0}))};const{default:r}=await import("../Function/Exec.js"),{default:o}=await import("../Function/Merge.js"),i=[],c=(await import("url")).fileURLToPath((await import("path")).dirname(import.meta.url));export{c as Current,r as Exec,o as Merge,i as Pipe,l as default}; +var c=async(...[s,a])=>{for(const e of s)for(const l of await(await import("fast-glob")).default(e.replaceAll("'","").replaceAll('"',""),{ignore:a?.Exclude??[]}))i.push(l);i.reverse(),console.log(i);let t=r((await import("../Variable/ESBuild.js")).default,{entryPoints:Object.fromEntries(i.map(e=>[e.replace("Source/","").replace("src/","").split(".").slice(0,-1).join("."),e]))});t=r(a?.ESBuild?r(t,await(await import("./File.js")).default(a.ESBuild)):t,{tsconfig:a?.TypeScript??"tsconfig.json"}),t.plugins?.push({name:"TypeScript",setup({onEnd:e}){e(async()=>{await o(`tsc -p ${t.tsconfig}`),await o(`tsc-alias -f -p ${t.tsconfig}`)})}}),a?.Watch?await(await(await import("esbuild")).context(t)).watch():console.log(await(await import("esbuild")).analyzeMetafile((await(await import("esbuild")).build(t))?.metafile??"",{verbose:!0}))};const{default:o}=await import("../Function/Exec.js"),{default:r}=await import("../Function/Merge.js"),i=[],p=(await import("url")).fileURLToPath((await import("path")).dirname(import.meta.url));export{p as Current,o as Exec,r as Merge,i as Pipe,c as default}; diff --git a/Target/Interface/Build.d.ts b/Target/Interface/Build.d.ts index 6280aed..0d32e22 100644 --- a/Target/Interface/Build.d.ts +++ b/Target/Interface/Build.d.ts @@ -19,6 +19,7 @@ export default interface Interface { ESBuild?: string; TypeScript?: string; Watch?: boolean; + Exclude?: Pattern[]; }): Promise; } import type { Pattern } from "fast-glob";