babel-loader
babel-loader copied to clipboard
babel-loader 6 complains 'unexpected token <' when using with react (possible regression)
This is my webpack.config.js for using with super-simple react application, when using with babel-loader 5.3.3 all works fine but when upgrading to babel-loader 6.0.1 this fails
module.exports = {
entry: './app.js',
module: {
loaders: [
{ test: /\.js$/, exclude: /node_modules/, loader: 'jsx-loader!babel-loader' }
]
}
}
This is the error:
ERROR in ./app.js
Module build failed: SyntaxError: /home/shikloshi/dev/private/react/appartment/app.js: Unexpected token (10:6)
8 | render() {
9 | return (
> 10 | <div>Hello</div>
| ^
11 | )
12 | }
Closing as this is a new behavior: http://stackoverflow.com/questions/33460420/babel-loader-jsx-syntaxerror-unexpected-token
Not
options: { presets: ['react'] } but
options: { presets: ['@babel/preset-react'] }