babel 7.x 和 webpack 4.x 配置
babel 6.x 升级到 babel 7.x
1. 命名方式改变
- babel-core → @babel/core
- babel-preset-* → @babel/preset-*
- babel-plugin-* → @babel/plugin-*
2. stage-* 已弃用
3. 最终文件
package.json
- 6.x 与 7.x 不兼容,所以 6.x 需升级至 7.x 。
- babel-loder 8.x 与 @babel/core 7.x 一起使用。
.babelrc