I want to handle my jsx code, so I write webpakc.config.js like this:
{
test: /\.js$/,
loaders: ['react-hot', 'babel-loader?presets[]=es2015'],
exclude: /node_modules/
}
But it didn't handle my jsx code and throw an error like this: The error threw in terminal
By Google I find I need to add presets['react']
to my config file. So I update config like this:
{
test: /\.js$/,
loaders: ['react-hot', 'babel'],
query: {
presets: ['react', 'es2015']
},
exclude: /node_modules/
}
But it threw another error: A new error threw after update config file
I am a fresher in webpack, What should I do?