text: const path = require("path");
  const webpack = require("webpack");
  const merge = require("webpack-merge");
  const common = require("./webpack.config.js");
  const MiniCssExtractPlugin = require("mini-css-extract-plugin");
  
  module.exports = merge(common, {
    mode: "production",
    optimization: {
      splitChunks: {
        cacheGroups: {
          styles: {
            name: "styles",
            test: /\.css$/,
            chunks: "all",
            enforce: true
          },
          vendors: {
            priority: -10,
            test: /[\\/]node_modules[\\/]/
          }
        },
  
        chunks: "async",
        minChunks: 1,
        minSize: 30000,
        name: true
      }
    },
  
    module: {
      rules: [
        {
          test: /\.scss$/,
          use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"]
        },
        {
          test: /\.css$/,
          use: [MiniCssExtractPlugin.loader, "css-loader"]
        }
      ]
    },
    plugins: [
      new webpack.DefinePlugin({
        "process.env.NODE_ENV": JSON.stringify("production")
      }),
      new MiniCssExtractPlugin({
        filename: "[name]-[hash].css",
        chunkFilename: "css/[id]-[hash].css",
        ignoreOrder: false
      })
    ],
    output: {
      filename: "js/[name]-bundle-[hash].js",
      path: path.resolve(__dirname, "../dist")
    }
  });
  