Let's now go through the steps of rendering:
- 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
- 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:
// ...