Babel

Since we will be using ES6 to write the backend code, we will configure and install Babel modules to convert ES6.

First, we configure Babel in the .babelrc file with presets for the latest JS features and some stage-x features not currently covered under babel-preset-env.

mern-skeleton/.babelrc:

{    "presets": [      "env",      "stage-2"    ]}

Next, we install the Babel modules as devDependencies from the command line:

npm install --save-dev babel-core babel-loader babel-preset-env babel-preset-stage-2

Once the module installations are done, you will notice that the devDependencies list has been updated in the package.json file.

Get Full-Stack React Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.