webpack.config.js 中配置babel-loader
{
exclude: /node_modules/,
test: /\.(js)$/,
loader: 'babel-loader'
}
.babelrc 配置使用babel-preset-env进行转码
{
"presets": ["env"]
}
babel-core也安装了
在build的时候报错了
ERROR in ./src/core/index.js
Module build failed (from ./node_modules/_babel-loader@8.0.2@babel-loader/lib/index.js):
Error: Unknown substitution "BODY" given
at Object.keys.forEach.key (E:\global\develop\visitor-next\node_modules\_@babel_template@7.0.0@@babel\template\lib\populate.js:35:15)
at Array.forEach (<anonymous>)
at populatePlaceholders (E:\global\develop\visitor-next\node_modules\_@babel_template@7.0.0@@babel\template\lib\populate.js:33:31)
at arg (E:\global\develop\visitor-next\node_modules\_@babel_template@7.0.0@@babel\template\lib\string.js:22:51)
at arg (E:\global\develop\visitor-next\node_modules\_@babel_template@7.0.0@@babel\template\lib\builder.js:77:14)
at spec (E:\global\develop\visitor-next\node_modules\_babel-plugin-transform-es2015-for-of@6.23.0@babel-plugin-transform-es2015-for-of\lib\index.js:171:20)
请大神赐教,是少了什么插件吗?
babel-core
安装了吗