const fs = require('fs') const path = require('path') const compiler = require('vue-template-compiler') const roots = [ path.join(__dirname, '../src/views'), path.join(__dirname, '../../saas-mgnui/src/views'), path.join(__dirname, '../../adminui/src/views') ] function walk(dir, files = []) { if (!fs.existsSync(dir)) return files for (const name of fs.readdirSync(dir)) { const full = path.join(dir, name) if (fs.statSync(full).isDirectory()) walk(full, files) else if (name.endsWith('.vue')) files.push(full) } return files } function rootTemplate(content) { const scriptIdx = content.search(/]/) const block = scriptIdx >= 0 ? content.slice(0, scriptIdx) : content const start = block.indexOf('') if (start < 0 || end <= start) return null return block.slice(start + '