webpack.config.js中区分production生产版和development开发版

适用于开发和生产共用一个webpack.config.js的情况:

const isProduction = process.argv[process.argv.indexOf('--mode') + 1] === 'production';
出处:(https://stackoverflow.com/questions/49274713/get-mode-in-webpack-config-webpack-4)