esbuild-wasm-deno/what/index.ts
2025-02-28 13:23:17 -05:00

21 lines
626 B
TypeScript

import Bundle from "../mod.ts";
const {outputFiles} = await Bundle(
// directory to work from
import.meta.resolve('./'),
// ESBuild configuration (entry points are relative to "directory"):
{entryPoints:["entry"]},
// import map (if omitted, will scan for a deno configuration within "directory" and use that)
{"imports": {
"entry": "./entry.ts",
"react": "https://esm.sh/preact@10.22.0/compat",
"react/": "https://esm.sh/preact@10.22.0/compat/"
}}
);
for(const item of outputFiles){
// do something with the output...
console.log(item.text.substring(0, 200));
}