20 lines
582 B
TypeScript
20 lines
582 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.ts"]},
|
|
|
|
// import map (if omitted, will scan for a deno configuration within "directory" and use that)
|
|
{"imports": {
|
|
"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);
|
|
}
|