May 2018
Intermediate to advanced
470 pages
13h 54m
English
For preparing the client-side code for production, update the config object with the following code in your webpack.config.client.production.js file.
mern-simplesetup/webpack.config.client.production.js:
const config = { mode: "production", entry: [ path.join(CURRENT_WORKING_DIR, 'client/main.js') ], output: { path: path.join(CURRENT_WORKING_DIR , '/dist'), filename: 'bundle.js', publicPath: "/dist/" }, module: { rules: [ { test: /\.jsx?$/, exclude: /node_modules/, use: [ 'babel-loader' ] } ] }}
This will configure Webpack for bundling the React code to be used in production mode, where the hot reloading plugin or debug configuration will no longer be required.
Read now
Unlock full access