babel 开发汇总

问题指南

npm start

Q:由于 babel@7 升级导致的 break change,transform-decorators-legacy 无需引入了,如果引入就会报以下错误:

1
2
3
4
5
6
7
8
9
$ npm start

Starting the development server...

Failed to compile.

./src/routes/orders/AllPaidOrderListPage.js
Module build failed: TypeError: Property right of AssignmentExpression expected node to be of a type ["Expression"] but instead got null
at Array.map (<anonymous>)

A:
.webpackrc.js中的transform-decorators-legacy进行删除。

问题详情:
babel-tutorial1.png

您的支持将鼓励我继续创作!