wanshenmean
2026-03-24 d01295c254063b3349a86a4474e04a62b284bd19
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const fs = require('fs');
const path = require('path');
 
const filePath = path.join(__dirname, 'Index.vue');
 
let content = fs.readFileSync(filePath, 'utf8');
 
// Read replacements from external JSON to avoid encoding issues in script
const replacements = JSON.parse(fs.readFileSync(path.join(__dirname, 'replacements.json'), 'utf8'));
 
for (const [old, newStr] of Object.entries(replacements)) {
    content = content.split(old).join(newStr);
}
 
fs.writeFileSync(filePath, content, 'utf8');
 
console.log('Fixed ' + Object.keys(replacements).length + ' replacements');