import { build, stop } from "https://deno.land/x/esbuild@v0.20.0/mod.js"; import { denoResolverPlugin, denoLoaderPlugin } from "https://deno.land/x/esbuild_deno_loader@0.9.0/mod.ts"; const result = await esbuild.build({ plugins: [denoResolverPlugin(), denoLoaderPlugin()], entryPoints: [Deno.args[0]], bundle: true, write: false, format: "esm", minify: true, charset: "utf8", }); const pages = [{ title: Deno.args[1], lines: [ Deno.args[1], "", "code:mod.js", ...result.outputFiles[0].text.split("\n").map((line) => ` ${line}`), ], }]; console.log(JSON.stringify({pages})); stop();