import importGlob from "../lib/scripts/esbuild-plugin-import-glob.mjs"; import buildIcons from "../lib/scripts/esbuild-plugin-build-icons.mjs"; import mapAliasedPath from "../lib/scripts/map-aliased-path.mjs"; import cleanPlugin from "../lib/scripts/esbuild-plugin-clean.mjs"; import { copy } from "esbuild-plugin-copy"; import { cocoPath } from "./utils.js"; const watch = process.argv.includes("--watch"); const dev = watch || process.argv.includes("--dev"); export default { entryPoints: ["coco.js"], bundle: true, metafile: true, outdir: cocoPath("@build"), absWorkingDir: cocoPath("@js"), entryNames: `[dir]${dev ? "/dev" : ""}/[name]`, logLevel: dev ? "warning" : "error", plugins: [ importGlob({ importMapper: mapAliasedPath, }), cleanPlugin({ initialCleanPatterns: [ "**/*", "!coco.css", "!coco.js", "!tailwind.preset.js", ], }), buildIcons( cocoPath("@npm/lucide-static/icons"), cocoPath("@build/icons"), cocoPath("@config") ), copy({ assets: [ { from: ["./app/assets/img/**/*"], to: ["./img"], }, { from: ["./app/assets/custom_icons/lucide/**/*"], to: ["./icons"], }, { from: ["./app/assets/custom_icons/other/**/*"], to: ["./icons/custom"], }, ], watch, }), ], format: "esm", platform: "node", };