意外的令牌导出Webpack [英] Unexpected token export webpack
本文介绍了意外的令牌导出Webpack的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这样的webpack配置:
I have webpack config like this:
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
}
]
和babel配置:
{
"presets": ['es2015'],
"plugins": ['transform-runtime']
}
但是浏览器显示以下消息:
But the browser shows this message:
未捕获的SyntaxError:意外的令牌导出
Uncaught SyntaxError: Unexpected token export
怎么了?
推荐答案
如果您使用的是webpack 2 loaders
,请成为rules
If you are using webpack 2 loaders
become rules
这篇关于意外的令牌导出Webpack的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文