#!/usr/bin/env node /* Build: bundle src/*.js + style.css into a single self-contained wuxia.html */ const fs = require('fs'); const path = require('path'); const SRC = path.join(__dirname, '..', 'src'); const OUT = path.join(__dirname, '..', 'wuxia.html'); const files = fs.readdirSync(SRC).filter(f => f.endsWith('.js')).sort(); let js = []; for (const f of files) { const code = fs.readFileSync(path.join(SRC, f), 'utf8'); js.push(`/* ==== ${f} ==== */\n` + code); } const css = fs.readFileSync(path.join(SRC, 'style.css'), 'utf8'); const html = ` Wuxia: 100 Days After — 武林百日后
`; fs.writeFileSync(OUT, html); console.log('Built', OUT, (html.length / 1024).toFixed(0) + ' KB', '| modules:', files.join(', '));