⊗tlWpMdCF 14 of 55 menu

Changing the build mode in the configuration file in Webpack

The build mode is controlled in the configuration file using the mode setting. Let's specify the development mode:

export default { mode: 'development', entry: './src/index.js', };

Now let's specify the production mode:

export default { mode: 'production', entry: './src/index.js', };

Build the project in development mode. Open the bundle file in the editor. Study it. Remember the size of this file.

Build the project in production mode. Open the bundle file in the editor. Study it. Compare the file size with the build size in development mode.

enru