May 2018
Intermediate to advanced
470 pages
13h 54m
English
During development, when we run the server, the Express app should load the Webpack middleware relevant to the frontend with respect to the configuration set for the client-side code, so that the frontend and backend development workflow is integrated. To enable this, we will use the devBundle.js file discussed in Chapter 2, Preparing the Development Environment, to set up a compile method that takes the Express app and configures it to use the Webpack middleware. The devBundle.js in the server folder will be as follows.
mern-skeleton/server/devBundle.js:
import config from './../config/config'import webpack from 'webpack'import webpackMiddleware from 'webpack-dev-middleware'import webpackHotMiddleware ...
Read now
Unlock full access