title: Why does webpack ignore chunk in production mode?
body: <p>I have multiple entry points that share same code. What I need to do is to extract this code into one file using <code>splitCode</code> in webpack 4. This works fine in <code>development</code> mode but not in <code>production</code>. </p>
  
  <p>Configuration file:</p>
  
  <pre><code>var path = require('path');
  const ManifestPlugin = require('webpack-manifest-plugin');
  const MiniCssExtractPlugin = require("mini-css-extract-plugin");
  const WebpackMd5Hash = require("webpack-md5-hash");
  const CleanWebpackPlugin = require('clean-webpack-plugin');
  
  module.exports = {
      mode: "development",
      module: {
          rules: [
              {
                  test: /\.vue$/,
                  loader: 'vue-loader'
              },
              {
                  test: /\.js$/,
                  exclude: /node_modules/,
                  use: {
  
                      loader: 'babel-loader',
                  }
              },
              {
                  test: /\.(sass|scss|css)$/,
                  use: [
                      "style-loader",
                      MiniCssExtractPlugin.loader,
                      "css-loader",
                      "sass-loader"
                  ]
              }
          ],
      },
      output: {
          path: path.join(__dirname, 'public'),
          filename: 'js/[name]-[chunkhash].js',
          chunkFilename: 'js/[name]-[chunkhash].js',
          publicPath: '/'
      },
      externals: {
          jquery: "jQuery"
      },
      optimization: {
          runtimeChunk: "single",
          splitChunks: {
              cacheGroups: {
                  vendor: {
                      test: /[\\/]node_modules[\\/]/,
                      name: "vendor",
                      chunks: "all",
                      priority: 1
                  },
                  utilities: {
                      test: /\.s?js$/,
                      minChunks: 2,
                      name: "utilities",
                      chunks: "all",
                      priority: 0
                  }
              }
          }
      },
      context: path.join(__dirname, 'resources/assets'),
      entry: {
          a: './js/a.js',
          b: './js/b.js'
      },
      plugins: [
          new CleanWebpackPlugin(['public/js/*.*', 'public/css/*.*'], {} ),
  
          new MiniCssExtractPlugin({
              filename: "css/[name]-[contenthash].css"
          }),
  
          new WebpackMd5Hash(),
  
          new ManifestPlugin({
              fileName: 'manifest.json'
          }),
      ]
  };
  </code></pre>
  
  <p>In development mode Webpack creates two entry points, one <code>runtime.js</code>, <code>vendor.js</code> and <code>utilities.js</code> which is ok. </p>
  
  <p>When I change mode from <code>development</code> to <code>production</code>, webpack ignores <code>utilities</code> cacheGroups and appends common codebase into two entry points.</p>
  
  <p>What am I missing?</p>
  
  <p>Webpack version: 4.28.4
  Node version: 8.15</p>