Files
MajoorWaldi-ComfyUI-Majoor-…/esbuild.mjs
T
MajoorWaldi 2abd0673b8 feat: add image operations nodes for composition, cropping, and drawing
- Implemented ImageOpsComp for image composition with multiple layers and blending modes.
- Created ImageOpsCrop for interactive cropping with aspect ratio support.
- Developed ImageOpsDraw for drawing on images with customizable tools and overlays.
- Added utility functions for handling crop and draw operations, including aspect ratio resolution and canvas management.
- Introduced TypeScript interfaces and utility functions for managing composition layers and crop rectangles in the preview.
2026-03-18 15:19:58 +01:00

40 lines
959 B
JavaScript

import { build, context } from "esbuild";
import { readdir } from "node:fs/promises";
import { join } from "node:path";
async function findTS(dir) {
const entries = await readdir(dir, { withFileTypes: true });
const files = [];
for (const e of entries) {
const full = join(dir, e.name);
if (e.isDirectory()) {
files.push(...await findTS(full));
} else if (e.name.endsWith(".ts") && !e.name.endsWith(".d.ts") && e.name !== "types.ts") {
files.push(full);
}
}
return files;
}
const entryPoints = await findTS("src");
const opts = {
entryPoints,
outdir: "js",
outbase: "src",
format: "esm",
platform: "browser",
target: "es2020",
bundle: false,
sourcemap: false,
};
if (process.argv.includes("--watch")) {
const ctx = await context(opts);
await ctx.watch();
console.log("[esbuild] watching...");
} else {
await build(opts);
console.log(`[esbuild] built ${entryPoints.length} files → js/`);
}