A v2 production configuration declared UglifyJs, the NODE_ENV define, module concatenation and the no-errors plugin by hand, and every project copied a slightly different version of the same block.
module.exports = {
mode: 'production', // or 'development'
entry: './src/index.js',
};
// production implies: minification, NODE_ENV=production,
// scope hoisting, side-effect-free module removal, no eval devtool
// development implies: eval-cheap-source-map, named modules,
// no minification, NODE_ENV=development
The defaults are almost always what was wanted, and overriding one of them is still possible through optimization. The cost is that they are invisible: a build behaving unexpectedly means reading the webpack source or the release notes rather than the project configuration. Omitting mode entirely defaults to production and prints a warning, which is a reasonable choice and confuses anyone who expected development.