I have a carousel file in which I want to get index.js and build block.build.js, so my webpack.config.js is:
Also from babel-loader v8, they have changed a little bit:
webpack 4.x | babel-loader 8.x | babel 7.x
npm install -D babel-loader @babel/core @babel/preset-env webpack
webpack 4.x | babel-loader 7.x | babel 6.x
npm install -D babel-loader@7 babel-core babel-preset-env webpack
(same thing for @babel/preset-react instead of babel-preset-react).