text: const path = require('path');
  const merge = require('webpack-merge');
  const webpack = require('webpack');
  
  process.env.NODE_ENV = 'test-production';
  
  const common = require('./webpack.common');
  const CleanWebpackPlugin = require('clean-webpack-plugin');
  const HtmlWebpackPlugin = require('html-webpack-plugin');
  const CopyWebpackPlugin = require('copy-webpack-plugin');
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
  const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
  const OptimizeCSSAssetsplugn = require('optimize-css-assets-webpack-plugin');
  
  const config = require('../config');
  
  module.exports = merge(common, {
    mode: 'production',
    optimization: {
      minimizer: [
        new UglifyJsPlugin({
          cache: true,
          parallel: true,
        }),
        new OptimizeCSSAssetsplugn({}),
      ]
    },
    plugins: [
      new webpack.DefinePlugin({
        'process.env': config
      }),
      new CleanWebpackPlugin(['../dist/*'], { allowExternal: true }),
      new MiniCssExtractPlugin({
        filename: 'app.[hash].css',
        chunkFilename: '[id].[hash].css',
      }),
      new HtmlWebpackPlugin({
        filename: 'index.html',
        template: './src/index.html',
        inject: true,
      }),
      new CopyWebpackPlugin([
        {
          from: path.resolve(__dirname, '../static'),
          to: 'static',
          ignore: ['^.*']
        }
      ]),
    ]
  });
  