Since babel 7, the behavior of the .babelrc file has changed. It used to walk up the directory tree until it ran into a .babelrc file, but now it stops when it sees a directory with package.json.
To make sure files in node_modules are still properly transpiled with our project settings, we need to switch to a project-wide configuration file. That boils down to the following:
rename .babelrc.js to babel.config.js
point babel-loader to use this new config file (this should happen automatically, but it's good to add this explicit reference just in case)
Since babel 7, the behavior of the .babelrc file has changed. It used to walk up the directory tree until it ran into a .babelrc file, but now it stops when it sees a directory with package.json.
See: https://babeljs.io/docs/en/config-files
To make sure files in node_modules are still properly transpiled with our project settings, we need to switch to a project-wide configuration file. That boils down to the following: