text: const merge = require('webpack-merge');
  const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
  const HtmlWebpackExternalsPlugin = require('html-webpack-externals-plugin');
  const cssnano = require('cssnano');
  const baseConfig = require('./webpack.base');
  
  const prodConfig = {
    mode: 'production',
    module: {
      rules: [
        {
          test: /\.css$/,
          use: 'ignore-loader',
        },
        {
          test: /\.less$/,
          use: 'ignore-loader',
        },
      ],
    },
    plugins: [
      new OptimizeCSSAssetsPlugin({
        assetNameRegExp: /\.css$/g,
        cssProcessor: cssnano,
      }),
      new HtmlWebpackExternalsPlugin({
        externals: [
          {
            module: 'react',
            entry: 'https://now8.gtimg.com/now/lib/16.8.6/react.min.js',
            global: 'React',
          },
          {
            module: 'react-dom',
            entry: 'https://now8.gtimg.com/now/lib/16.8.6/react-dom.min.js',
            global: 'ReactDOM',
          },
        ],
      }),
    ],
    optimization: {
      splitChunks: {
        minSize: 0,
        cacheGroups: {
          commons: {
            name: 'commons',
            chunks: 'all',
            minChunks: 2,
          },
        },
      },
    },
  };
  
  module.exports = merge(baseConfig, prodConfig);
  