wechat-miniprogram / miniprogram-slim

MIT License
126 stars 13 forks source link

请求支持babel的@babel/plugin-proposal-class-properties插件 #8

Open oddjohn opened 3 years ago

oddjohn commented 3 years ago

miniprogram-slim analyzer -t分析时候报错

analyze app.json/usr/local/lib/node_modules/miniprogram-slim/node_modules/@babel/parser/lib/index.js:771
      throw err;
      ^

SyntaxError: This experimental syntax requires enabling the parser plugin: 'classProperties' (4:11)
Double-Lv commented 3 years ago

同样的报错

zkisme commented 3 years ago

同样的报错

1728317209 commented 3 years ago

clone 下来自己改一下

{
  "dependencies": {
     "@babel/plugin-proposal-class-properties": "^7.8.3",
  }
}

src/depsAnalyzer/handler/esmodule.js#L12 改成👇

const ast = parser.parse(code, {sourceType: 'module', plugins: ['classProperties']})