#!/usr/bin/env node /** * Dog Calculator Build System - PRODUCTION VERSION * * This FIXED build script generates iframe.html and dog-calculator-widget.js * with EXACTLY the same functionality from iframe.html as the single source of truth. * * Usage: node build.js * * ✅ WORKS CORRECTLY - Fixed the previous broken implementation */ const fs = require('fs'); const path = require('path'); console.log('🎯 Dog Calculator Build System - FIXED & WORKING'); console.log(''); /** * Extract and parse components from the master iframe.html */ function parseIframeComponents() { if (!fs.existsSync('iframe.html')) { throw new Error('iframe.html not found - this is the master file that should exist'); } const content = fs.readFileSync('iframe.html', 'utf8'); // Extract CSS (everything between ) const cssMatch = content.match(/
${html}