// Regenerates style.min.css and script.min.js from the source files.
//
// Usage: node minify.js
//
// Run this EVERY TIME style.css or script.js is edited, before deploying —
// all 18 pages load the .min versions, so the source files being up to date
// is not enough; the .min files must be regenerated too or the live site
// will serve stale CSS/JS.

const { execSync } = require('child_process');

console.log('Minifying style.css -> style.min.css ...');
execSync('npx --yes clean-css-cli style.css -o style.min.css', { stdio: 'inherit' });

console.log('Minifying script.js -> script.min.js ...');
execSync('npx --yes terser script.js -o script.min.js --compress --mangle', { stdio: 'inherit' });

console.log('\nDone.');
