上QQ阅读APP看书,第一时间看更新
Webpack
We will have to configure Webpack for bundling both the client and server code and the client code separately for production code. 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:
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.