20 lines
674 B
JavaScript
20 lines
674 B
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const root = path.join(__dirname, '..');
|
|
const componentsDir = path.join(root, 'components/memberInfo');
|
|
|
|
const componentFiles = fs.readdirSync(componentsDir).filter((name) => name.endsWith('.vue'));
|
|
|
|
for (const file of componentFiles) {
|
|
const filePath = path.join(componentsDir, file);
|
|
let content = fs.readFileSync(filePath, 'utf8').replace(/\r\n/g, '\n');
|
|
const next = content.replace(/\n<style>[\s\S]*?<\/style>\n?/g, '\n');
|
|
if (next !== content) {
|
|
fs.writeFileSync(filePath, next.trimEnd() + '\n', 'utf8');
|
|
console.log('removed style block:', file);
|
|
}
|
|
}
|
|
|
|
console.log('done');
|