/** * Copyright (c) 2026 The xterm.js authors. All rights reserved. * @license MIT */ import { readFileSync, writeFileSync } from 'fs'; import { join, dirname } from 'path'; import { fileURLToPath } from 'url'; const __dirname = dirname(fileURLToPath(import.meta.url)); const root = join(__dirname, '..'); const wasm = readFileSync(join(root, 'src/common/parser/wasm/parser.wasm')); const b64 = wasm.toString('base64'); const out = `/** * Copyright (c) 2026 The xterm.js authors. All rights reserved. * @license MIT */ /** Base64-encoded parser.wasm (generated by bin/build_parser_wasm.sh) */ export const PARSER_WASM_BASE64 = '${b64}';\n`; writeFileSync(join(root, 'src/common/parser/wasm/parser.wasm.embed.ts'), out); console.info(`Embedded parser.wasm (${wasm.length} bytes)`);