Module build failed: Error: The node API for `babel` has been moved to `babel-core`.

.pipe(gulpwebpack({

module:{

loaders:[{

test:/\.js$/,

loader:'babel'

}]

}

}),null,(err,stats)=>{

log(`Finished '${color.cyan('scripts')}'`,stats.toString({

chunks:false

}))

})

重新编译是loader:'babel'会出现Module build failed: Error: The node API for `babel` has been moved to `babel-core`.这样的错误提示,这是怎么回事?改成loader:'babel-loader'又好了

慕田峪0890731
浏览 5069回答 1
1回答

Caballarii

babel的库被拆分了,以前的写法是babel,最新版本需要用babel的loader的话要写成babel-loader。版本问题,你看的教程太老了
打开App,查看更多内容
随时随地看视频慕课网APP