Deno scriptをbundle & minifyする
Deno script を bundle & minify するscriptの例
code:bundle.ts
import { denoPlugins } from "jsr:@luca/esbuild-deno-loader@0.9";
const outDir = "dist/";
esbuild.build({
entryPoints,
outdir,
bundle: true,
platform: "browser",
format: "esm",
target: "esnext",
minify: true,
sourcemap: true,
treeShaking: true,
});
await esbuild.stop();
deno.json に以下を追加
code:deno.json
{
"tasks": {
"bundle": "deno run --allow-read --allow-write --allow-env --allow-net --allow-run bundle.ts"
}
}
References