Unexpected export token export

I have a webpack config like this:

loaders: [ { test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' } ] 

And the babel config:

 { "presets": ['es2015'], "plugins": ['transform-runtime'] } 

But the browser shows this message:

Inactive SyntaxError: Unexpected Token Export

What's wrong?

+6
source share
1 answer

If you use webpack 2 loaders become rules

0
source

Source: https://habr.com/ru/post/1011623/


All Articles