mirror of
https://github.com/BlowaterNostr/blowater.git
synced 2024-10-18 07:33:22 +00:00
0c494506f5
Co-authored-by: BlowaterNostr <blowater.nostr@proton.me>
27 lines
794 B
TypeScript
27 lines
794 B
TypeScript
import { walk } from "@std/fs/walk";
|
|
import * as esbuild from "npm:esbuild@0.20.2";
|
|
import * as loader from "jsr:@luca/esbuild-deno-loader@^0.10.3";
|
|
import { join } from "@std/path";
|
|
|
|
const page = Deno.args[0] || "";
|
|
|
|
for await (
|
|
const entry of walk("./", { exts: [page + ".test.tsx"] })
|
|
) {
|
|
console.log("compiling", entry.path);
|
|
const result = await esbuild.build({
|
|
plugins: [...loader.denoPlugins({
|
|
loader: "native",
|
|
configPath: join(Deno.cwd(), "deno.json"),
|
|
})],
|
|
jsxFactory: "h",
|
|
jsxFragment: "Fragment",
|
|
entryPoints: [`./app/UI/${page ? page + ".test.tsx" : "_main.tsx"}`],
|
|
outfile: "app/UI/assets/main.mjs",
|
|
bundle: true,
|
|
format: "esm",
|
|
});
|
|
console.log(result);
|
|
}
|
|
esbuild.stop();
|