webpack.config.js
function getMode(env, argv) {
  // When running from parallel-webpack, grab the cli parameters
  argv = Object.keys(argv).length ? argv : require('minimist')(process.argv.slice(2));
  var isProd = (argv.mode || env.mode) === 'production' || env === 'prod' || env.prod;
  return isProd ? 'production' : 'development';
}
function getMode(env, argv) {
  // When running from parallel-webpack, grab the cli parameters
  argv = Object.keys(argv).length ? argv : require('minimist')(process.argv.slice(2));
  var isProd = (argv.mode || env.mode) === 'production' || env === 'prod' || env.prod;
  return isProd ? 'production' : 'development';
}
Determine the build mode.
@param {object} env - webpack environment
@param {boolean} [env.production] - when true, set mode to production
@param {boolean} [env.development] - when true, set mode to development
@param {object} argv - webpack options
@param {string} [argv.mode] - the build mode