April 2020
Intermediate to advanced
716 pages
18h 55m
English
We will have to configure Webpack to bundle both the client and server code and the client code separately for production. Create webpack.config.client.js, webpack.config.server.js, and webpack.config.client.production.js files in your project folder. All three files will have the following code structure, starting with imports, then the definition of the config object, and finally the export of the defined config object:
const path = require('path')const webpack = require('webpack')const CURRENT_WORKING_DIR = process.cwd()const config = { ... }module.exports = config
The config JSON object will differ with values specific to the client- or server-side code, and development versus production code. In the following sections, we will ...
Read now
Unlock full access