1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2025-07-01 12:22:15 +02:00

🔤 dd<el>, iief

This commit is contained in:
2025-03-07 21:32:15 +01:00
parent d56d5e45d5
commit d742d960ac
22 changed files with 111 additions and 109 deletions

View File

@ -1,10 +1,9 @@
#!/usr/bin/env -S npx nodejsscript
import { bundle, bundle as bundleDTS } from "dts-bundler";
const css= echo.css`
.info{ color: gray; }
`;
export async function build({ files, filesOut, minify= "partial", dde= true }){
export async function build({ files, filesOut, minify= "partial", iife= true }){
for(const file_root of files){
const file= file_root+".js";
echo(`Processing ${file} (minified: ${minify})`);
@ -21,17 +20,17 @@ export async function build({ files, filesOut, minify= "partial", dde= true }){
});
echoVariant(file_dts_out);
if(dde) toDDE(file, file_root);
if(iife) toIIFE(file, file_root);
}
return 0;
async function toDDE(file, file_root){
const name= "dde";
async function toIIFE(file, file_root){
const name= "iife";
const out= filesOut(file_root+".js", name);
const params= [
"--format=iife",
"--global-name="+name,
"--global-name=dde",
];
const dde_output= buildEsbuild({ file, out, minify, params });
echoVariant(`${out} (${file} → globalThis.${name})`)