diff --git a/bundler.ts b/bundler.ts index 6d076bc..57f8515 100644 --- a/bundler.ts +++ b/bundler.ts @@ -65,3 +65,21 @@ export const buildJS = await esbuild.context({ format: "esm", target: ["deno2", "chrome67", "firefox68"], }); + +/** + * Extract Lufi from a Deno lib to a JS file + */ +export const extractLufi = await esbuild.context({ + plugins: [...denoPlugins()], + entryPoints: ["@booteille/lufi-api"], + outdir: `${themeDir}/public/js/lib`, + entryNames: "lufi", + bundle: true, + minify: false, + sourcemap: false, + allowOverwrite: true, + format: "esm", + target: ["deno2", "chrome67", "firefox68"], +}); +await extractLufi.rebuild(); +extractLufi.dispose(); diff --git a/deno.json b/deno.json index 1843887..ed71f17 100644 --- a/deno.json +++ b/deno.json @@ -4,6 +4,7 @@ "watch": "deno run --allow-all bundler.watch.ts" }, "imports": { + "@booteille/lufi-api": "jsr:@booteille/lufi-api@^0.3.0", "@fortawesome/fontawesome-free": "npm:@fortawesome/fontawesome-free@^6.7.2", "esbuild": "npm:esbuild@^0.25.4", "esbuild-plugin-ignore": "npm:esbuild-plugin-ignore@^1.1.1",