webpack配置es6高级语法
##安装配置项(通过yarn)
yarn add babel-core babel-loader@7.1.5 babel-plugin-transform-runtime babel-preset-env babel-preset-stage-0 --dev
##在webpack.config.js中增加一个规则项
module:{
rules:[
{test:/\.js$/,use:'babel-loader',exclude:/node_modules/},
]
}
##在项目根目录中创建一个.babelrc的文件,写入
{
"presets":["env","stage-0"],
"plugins": ["transform-runtime"]
}