Files
vibemake/scripts/xacro-bundle.mjs
T
Jerry 46e1b5be65 Initial commit: vibemake site
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 14:04:08 +08:00

10 lines
621 B
JavaScript

// 把 xacro-parser 打成一个浏览器可直接 import 的文件:vendor/xacro/xacro-parser.js
// 只在升级依赖时运行:node scripts/xacro-bundle.mjs
import { build } from 'esbuild';
import { writeFileSync, rmSync } from 'node:fs';
const entry = new URL('./.xacro-entry.mjs', import.meta.url).pathname;
writeFileSync(entry, "export { XacroParser } from 'xacro-parser/src/XacroParser.js';\n");
await build({ entryPoints: [entry], bundle: true, format: 'esm', minify: true, platform: 'browser', outfile: new URL('../vendor/xacro/xacro-parser.js', import.meta.url).pathname });
rmSync(entry);
console.log('ok');