April 2020
Intermediate to advanced
716 pages
18h 55m
English
To compile React, first, install the Babel React preset module as a development dependency by running the following command from the command line:
yarn add --dev @babel/preset-react
Then, update .babelrc with the following code. This will include the module and also configure the react-hot-loader Babel plugin as required for the react-hot-loader module.
mern-skeleton/.babelrc:
{ "presets": [ ["@babel/preset-env", { "targets": { "node": "current" } } ], "@babel/preset-react" ], "plugins": [ "react-hot-loader/babel" ]}
To put this updated Babel configuration to use, we need to update the Webpack configuration, which we will look at in the next section.
Read now
Unlock full access