<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong></p>


<p dir="auto"><strong>What is the current behavior?</strong><br>
RT<br>
<strong>If the current behavior is a bug, please provide the steps to reproduce.</strong><br>
I have a  multi Page app and I have two enties 'main.js','main2.js' for two pages.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="//main.js
require(['./a','./b','./c'],function(){
    console.log('main')
})"><pre class="notranslate"><span class="pl-c">//main.js</span>
<span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-s">'./a'</span><span class="pl-kos">,</span><span class="pl-s">'./b'</span><span class="pl-kos">,</span><span class="pl-s">'./c'</span><span class="pl-kos">]</span><span class="pl-kos">,</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'main'</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="//main2.js
require(['./a','./b','./d'],function(){
    console.log('main')
})"><pre class="notranslate"><span class="pl-c">//main2.js</span>
<span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-s">'./a'</span><span class="pl-kos">,</span><span class="pl-s">'./b'</span><span class="pl-kos">,</span><span class="pl-s">'./d'</span><span class="pl-kos">]</span><span class="pl-kos">,</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'main'</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div>
<p dir="auto">as you see. two entries share common './a', ',/b'.<br>
if bundle the code now , './a', ',/b' will apear twice , result in large file size if they are big files<br>
then I want to use CommonsChunksPlugins to remove duplicate module like</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="//webpack.config.js
new webpack.optimize.CommonsChunkPlugin({
	async: true,
        minChunks: 2
})"><pre class="notranslate"><span class="pl-c">//webpack.config.js</span>
<span class="pl-k">new</span> <span class="pl-s1">webpack</span><span class="pl-kos">.</span><span class="pl-c1">optimize</span><span class="pl-kos">.</span><span class="pl-c1">CommonsChunkPlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
	<span class="pl-c1">async</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
        <span class="pl-c1">minChunks</span>: <span class="pl-c1">2</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div>
<p dir="auto">nothing change... then i change to</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    entry:{
        main:'./main.js',
        main2:'./main2.js',
        common:['./a','./b']
    },
    plugins: [
	 new webpack.optimize.CommonsChunkPlugin({
		name: ['share','common'],
		async: true,
               minChunks: 2
	  })
	]"><pre class="notranslate">    entry:<span class="pl-kos">{</span>
        <span class="pl-c1">main</span>:<span class="pl-s">'./main.js'</span><span class="pl-kos">,</span>
        <span class="pl-c1">main2</span>:<span class="pl-s">'./main2.js'</span><span class="pl-kos">,</span>
        <span class="pl-c1">common</span>:<span class="pl-kos">[</span><span class="pl-s">'./a'</span><span class="pl-kos">,</span><span class="pl-s">'./b'</span><span class="pl-kos">]</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-s1">plugins</span>: <span class="pl-kos">[</span>
	 <span class="pl-k">new</span> <span class="pl-s1">webpack</span><span class="pl-kos">.</span><span class="pl-c1">optimize</span><span class="pl-kos">.</span><span class="pl-c1">CommonsChunkPlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
		<span class="pl-c1">name</span>: <span class="pl-kos">[</span><span class="pl-s">'share'</span><span class="pl-kos">,</span><span class="pl-s">'common'</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
		<span class="pl-c1">async</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
               <span class="pl-c1">minChunks</span>: <span class="pl-c1">2</span>
	  <span class="pl-kos">}</span><span class="pl-kos">)</span>
	<span class="pl-kos">]</span></pre></div>
<p dir="auto">this time it generate share.js contain './a', ',/b'.<br>
but entries main.js and main2.js still contain './a', ',/b'. it does not reduce ouptsize</p>



<p dir="auto"><strong>What is the expected behavior?</strong><br>
extract common modules from entries to  #share.js<br>
<strong>Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.</strong><br>
Window10<br>
Webpack 2.2.0<br>
node 6.9.2</p>
<h1 dir="auto">Bug report</h1>




<p dir="auto"><strong>What is the current behavior?</strong></p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[webpack-cli] 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 (/opt/src/node_modules/webpack/lib/util/createHash.js:155:18)
    at BulkUpdateDecorator.digest (/opt/src/node_modules/webpack/lib/util/createHash.js:80:21)
    at /opt/src/node_modules/webpack/lib/DefinePlugin.js:595:38
    at Hook.eval [as call] (eval at create (/opt/src/node_modules/tapable/lib/HookCodeFactory.js:19:10), &lt;anonymous&gt;:100:1)
    at Hook.CALL_DELEGATE [as _call] (/opt/src/node_modules/tapable/lib/Hook.js:14:14)
    at Compiler.newCompilation (/opt/src/node_modules/webpack/lib/Compiler.js:1053:26)
    at /opt/src/node_modules/webpack/lib/Compiler.js:1097:29
    at Hook.eval [as callAsync] (eval at create (/opt/src/node_modules/tapable/lib/HookCodeFactory.js:33:10), &lt;anonymous&gt;:6:1) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}"><pre class="notranslate">[webpack-cli] 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 (/opt/src/node_modules/webpack/lib/util/createHash.js:155:18)
    at BulkUpdateDecorator.digest (/opt/src/node_modules/webpack/lib/util/createHash.js:80:21)
    at /opt/src/node_modules/webpack/lib/DefinePlugin.js:595:38
    at Hook.eval [as call] (eval at create (/opt/src/node_modules/tapable/lib/HookCodeFactory.js:19:10), <span class="pl-k">&lt;</span>anonymous<span class="pl-k">&gt;</span>:100:1)
    at Hook.CALL_DELEGATE [as _call] (/opt/src/node_modules/tapable/lib/Hook.js:14:14)
    at Compiler.newCompilation (/opt/src/node_modules/webpack/lib/Compiler.js:1053:26)
    at /opt/src/node_modules/webpack/lib/Compiler.js:1097:29
    at Hook.eval [as callAsync] (eval at create (/opt/src/node_modules/tapable/lib/HookCodeFactory.js:33:10), <span class="pl-k">&lt;</span>anonymous<span class="pl-k">&gt;</span>:6:1) {
  opensslErrorStack: [ <span class="pl-s"><span class="pl-pds">'</span>error:03000086:digital envelope routines::initialization error<span class="pl-pds">'</span></span> ],
  library: <span class="pl-s"><span class="pl-pds">'</span>digital envelope routines<span class="pl-pds">'</span></span>,
  reason: <span class="pl-s"><span class="pl-pds">'</span>unsupported<span class="pl-pds">'</span></span>,
  code: <span class="pl-s"><span class="pl-pds">'</span>ERR_OSSL_EVP_UNSUPPORTED<span class="pl-pds">'</span></span>
}</pre></div>
<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version:  5.59.0<br>
Node.js version: 17.0.0<br>
Operating System: linux x64</p>