23 lines
554 B
TypeScript
23 lines
554 B
TypeScript
import { build } from "@char/aftercare/esbuild";
|
|
|
|
if (import.meta.main) {
|
|
const watch = Deno.args.includes("--watch");
|
|
await build({
|
|
in: ["./client/main.tsx", "./client/deps/hljs.ts"],
|
|
outDir: "./client/web/dist",
|
|
watch,
|
|
plugins: [
|
|
{
|
|
name: "deps-external",
|
|
setup: build => {
|
|
build.onResolve({ filter: /^deps\// }, args => {
|
|
return { path: args.path.replace(/.ts$/, ".js"), external: true };
|
|
});
|
|
},
|
|
},
|
|
],
|
|
extraOptions: {
|
|
splitting: true,
|
|
},
|
|
});
|
|
}
|