April 2020
Intermediate to advanced
716 pages
18h 55m
English
Update the config object with the following in your webpack.config.client.js file in order to configure Webpack to bundle and hot-load React code during development:
mern-simplesetup/webpack.config.client.js:
const config = { name: "browser", mode: "development", devtool: 'eval-source-map', entry: [ 'webpack-hot-middleware/client?reload=true', 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'] } ] }, plugins: [ new webpack.HotModuleReplacementPlugin(), new webpack.NoEmitOnErrorsPlugin() ], resolve: { ...