const fs = require('fs'); ['uniapp/pages/member/index.vue', 'uniapp/pages/member/recharge.vue'].forEach(f => { const content = fs.readFileSync(f, 'utf8'); const script = content.match(/([\s\S]*?)<\/script>/)[1]; try { const clean = script .replace(/import\s+.*?from\s+['"].*?['"];?/g, '') .replace(/export\s+default\s+/, 'const _obj = '); new Function(clean); console.log(f, "JS_SYNTAX_OK"); } catch(e) { console.error(f, "JS_ERROR", e); } });