April 2020
Intermediate to advanced
716 pages
18h 55m
English
During development, when we run the server, the Express app should also load the Webpack middleware that's relevant to the frontend with respect to the configuration that's been 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 we discussed in Chapter 2, Preparing the Development Environment, in order to set up a compile method that takes the Express app and configures it to use the Webpack middleware. The devBundle.js file in the server folder will look as follows.
mern-skeleton/server/devBundle.js:
import config from './../config/config'import webpack from 'webpack'import webpackMiddleware from 'webpack-dev-middleware' ...
Read now
Unlock full access