I have webpack config like this:
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
}
]
And babel config:
{
"presets": ['es2015'],
"plugins": ['transform-runtime']
}
But the browser shows this message:
Uncaught SyntaxError: Unexpected token export
What is wrong?
To solve the "Uncaught SyntaxError Unexpected token 'export'", refactor your code to use the CommonJS syntax, e.g. module. exports = {num}; instead of export num = 10; . Copied!
If you are using webpack 2 loaders
become rules
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With