How to do it...

Let's now go through the steps of rendering:

  1. First, we need to add our npm scripts to our package.json file:
    "scripts": {      "clean": "rm -rf dist/ && rm -rf public/app",      "start": "npm run clean & NODE_ENV=development       BABEL_ENV=development       nodemon src/server --watch src/server --watch src/shared --       exec babel-node --presets es2015",      "start-analyzer": "npm run clean && NODE_ENV=development       BABEL_ENV=development ANALYZER=true babel-node src/server"    }
File: package.json
  1. Now we have to change our webpack.config.js file. Because we are going to implement SSR, we need to separate our Webpack configuration into a client configuration and server configuration, returning them as an array. The file should look like this:
  // ...

Get React Cookbook 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.