<p dir="auto">For building a lib i want to disable codeSplitting with webpack</p>
<p dir="auto">adding the LimitChunkCountPlugin</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="   plugins: [
    new webpack.optimize.LimitChunkCountPlugin({
      maxChunks: 1,
    }),
  ],"><pre class="notranslate"><code class="notranslate">   plugins: [
    new webpack.optimize.LimitChunkCountPlugin({
      maxChunks: 1,
    }),
  ],
</code></pre></div>
<p dir="auto">but get this error on build</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ERROR in webpack/runtime/runtimeId
RuntimeIdRuntimeModule must be in a single runtime
Error: RuntimeIdRuntimeModule must be in a single runtime
    at RuntimeIdRuntimeModule.generate (/home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/runtime/RuntimeIdRuntimeModule.js:22:10)
    at RuntimeIdRuntimeModule.getGeneratedCode (/home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/RuntimeModule.js:182:44)
    at RuntimeIdRuntimeModule.codeGeneration (/home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/RuntimeModule.js:137:30)
    at /home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/Compilation.js:3324:22
    at /home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/Cache.js:93:5
    at Hook.eval [as callAsync] (eval at create (/home/arpu/Work/projects/vland_app/vland_app/node_modules/tapable/lib/HookCodeFactory.js:33:10), &lt;anonymous&gt;:6:1)
    at Cache.get (/home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/Cache.js:75:18)
    at ItemCacheFacade.get (/home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/CacheFacade.js:111:15)
    at Compilation._codeGenerationModule (/home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/Compilation.js:3317:9)
    at /home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/Compilation.js:3224:11
"><pre class="notranslate"><code class="notranslate">ERROR in webpack/runtime/runtimeId
RuntimeIdRuntimeModule must be in a single runtime
Error: RuntimeIdRuntimeModule must be in a single runtime
    at RuntimeIdRuntimeModule.generate (/home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/runtime/RuntimeIdRuntimeModule.js:22:10)
    at RuntimeIdRuntimeModule.getGeneratedCode (/home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/RuntimeModule.js:182:44)
    at RuntimeIdRuntimeModule.codeGeneration (/home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/RuntimeModule.js:137:30)
    at /home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/Compilation.js:3324:22
    at /home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/Cache.js:93:5
    at Hook.eval [as callAsync] (eval at create (/home/arpu/Work/projects/vland_app/vland_app/node_modules/tapable/lib/HookCodeFactory.js:33:10), &lt;anonymous&gt;:6:1)
    at Cache.get (/home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/Cache.js:75:18)
    at ItemCacheFacade.get (/home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/CacheFacade.js:111:15)
    at Compilation._codeGenerationModule (/home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/Compilation.js:3317:9)
    at /home/arpu/Work/projects/vland_app/vland_app/node_modules/webpack/lib/Compilation.js:3224:11

</code></pre></div>
<p dir="auto">without the plugin all works fine</p>
<p dir="auto">node v14.19.0<br>
webpack 5.69.1</p>
<h1 dir="auto">Bug report</h1>




<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">When updating the code loaded by web worker nothing happens.</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<p dir="auto">This is a very simple configuration where HMR doesn't work:<br>
<a href="https://github.com/wclr/webpack-worker-hot-reload">https://github.com/wclr/webpack-worker-hot-reload</a></p>






<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">I believe it should work the following way:</p>
<ol dir="auto">
<li>If the worker's entry script accepts hot reload, hot reload should be executed in the context of running web worker(s).</li>
<li>Otherwise it should be upstreamed to the parent context (probably parent script where <code class="notranslate">new URL</code> of the worker script was created).</li>
</ol>


<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version:  5<br>
Node.js version: 14<br>
Operating System:<br>
Additional tools:</p>