Run:
yarn -D babel-loader @babel/core
Create a file named .babelrc
with the following contents in the root folder of your project:
{
"presets": ["qred"]
}
In your webpack.config.js
add the following section:
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: "babel-loader"
}
]
}