const fs = require('fs'); const path = require('path'); // Function to update index.html with dynamic SEO data async function updateIndexHTML(seoData) { const indexPath = path.join(__dirname, '../dist/index.html'); let html = fs.readFileSync(indexPath, 'utf8'); // Replace meta tags with dynamic data html = html.replace( //, `` ); html = html.replace( //, `` ); html = html.replace( //, `` ); html = html.replace( //, `` ); html = html.replace( /[^<]*<\/title>/, `<title>${seoData.metaTitle}` ); // Write updated HTML fs.writeFileSync(indexPath, html); console.log('SEO updated successfully!'); } module.exports = { updateIndexHTML };