title: Webpack build failing with ERR_OSSL_EVP_UNSUPPORTED
body: <p>I'm having an issue with a Webpack build process that suddenly broke, resulting in the following error...</p>
  <pre class="lang-none prettyprint-override"><code>&lt;s&gt; [webpack.Progress] 10% building 0/1 entries 0/0 dependencies 0/0 modules
  node:internal/crypto/hash:67
    this[kHandle] = new _Hash(algorithm, xofLen);
                    ^
  
  Error: error:0308010C:digital envelope routines::unsupported
      at new Hash (node:internal/crypto/hash:67:19)
      at Object.createHash (node:crypto:130:10)
      at BulkUpdateDecorator.hashFactory (/app/node_modules/webpack/lib/util/createHash.js:155:18)
      at BulkUpdateDecorator.update (/app/node_modules/webpack/lib/util/createHash.js:46:50)
      at OriginalSource.updateHash (/app/node_modules/webpack-sources/lib/OriginalSource.js:131:8)
      at NormalModule._initBuildHash (/app/node_modules/webpack/lib/NormalModule.js:888:17)
      at handleParseResult (/app/node_modules/webpack/lib/NormalModule.js:954:10)
      at /app/node_modules/webpack/lib/NormalModule.js:1048:4
      at processResult (/app/node_modules/webpack/lib/NormalModule.js:763:11)
      at /app/node_modules/webpack/lib/NormalModule.js:827:5 {
    opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
    library: 'digital envelope routines',
    reason: 'unsupported',
    code: 'ERR_OSSL_EVP_UNSUPPORTED'
  }
  command terminated with exit code 1
  </code></pre>
  <p>I've tried googling <code>ERR_OSSL_EVP_UNSUPPORTED webpack</code> which yielded almost no useful results, but it did highlight an issue using MD4 as provided by <a href="https://en.wikipedia.org/wiki/OpenSSL" rel="noreferrer">OpenSSL</a> (which is apparently deprecated?) to generate hashes.</p>
  <p>The webpack.config.js code is as follows:</p>
  <pre class="lang-js prettyprint-override"><code>const path = require('path');
  const webpack = require('webpack');
  
  /*
   * SplitChunksPlugin is enabled by default and replaced
   * deprecated CommonsChunkPlugin. It automatically identifies modules which
   * should be splitted of chunk by heuristics using module duplication count and
   * module category (i. e. node_modules). And splits the chunks…
   *
   * It is safe to remove &quot;splitChunks&quot; from the generated configuration
   * and was added as an educational example.
   *
   * https://webpack.js.org/plugins/split-chunks-plugin/
   *
   */
  
  /*
   * We've enabled TerserPlugin for you! This minifies your app
   * in order to load faster and run less javascript.
   *
   * https://github.com/webpack-contrib/terser-webpack-plugin
   *
   */
  
  const TerserPlugin = require('terser-webpack-plugin');
  
  module.exports = {
      mode: 'development',
      entry: './src/js/scripts.js',
  
      output: {
          path: path.resolve(__dirname, 'js'),
          filename: 'scripts.js'
      },
  
      devtool: 'source-map',
  
      plugins: [new webpack.ProgressPlugin()],
  
      module: {
          rules: []
      },
  
      optimization: {
          minimizer: [new TerserPlugin()],
  
          splitChunks: {
              cacheGroups: {
                  vendors: {
                      priority: -10,
                      test: /[\\/]node_modules[\\/]/
                  }
              },
  
              chunks: 'async',
              minChunks: 1,
              minSize: 30000,
              name: 'true'
          }
      }
  };
  </code></pre>
  <p>How do I change the hashing algorithm used by Webpack to something else?</p>