<h2 dir="auto">Feature request</h2>





<p dir="auto"><strong>What is the expected behavior?</strong><br>
I have a plugin which creates a child compiler. And I want to apply the same optimization plugins that </p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/webpack/webpack/blob/a16909c5fdb9efe9f1dd20226a1e7fc216160d1a/lib/WebpackOptionsApply.js#L293-L456">webpack/lib/WebpackOptionsApply.js</a>
    </p>
    <p class="mb-0 color-fg-muted">
        Lines 293 to 456
      in
      <a data-pjax="true" class="commit-tease-sha" href="/webpack/webpack/commit/a16909c5fdb9efe9f1dd20226a1e7fc216160d1a">a16909c</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L293" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="293"></td>
          <td id="LC293" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">removeAvailableModules</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L294" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="294"></td>
          <td id="LC294" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">const</span> <span class="pl-v">RemoveParentModulesPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./optimize/RemoveParentModulesPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L295" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="295"></td>
          <td id="LC295" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">new</span> <span class="pl-v">RemoveParentModulesPlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L296" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="296"></td>
          <td id="LC296" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L297" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="297"></td>
          <td id="LC297" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">removeEmptyChunks</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L298" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="298"></td>
          <td id="LC298" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">const</span> <span class="pl-v">RemoveEmptyChunksPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./optimize/RemoveEmptyChunksPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L299" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="299"></td>
          <td id="LC299" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">new</span> <span class="pl-v">RemoveEmptyChunksPlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L300" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="300"></td>
          <td id="LC300" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L301" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="301"></td>
          <td id="LC301" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">mergeDuplicateChunks</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L302" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="302"></td>
          <td id="LC302" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">const</span> <span class="pl-v">MergeDuplicateChunksPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./optimize/MergeDuplicateChunksPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L303" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="303"></td>
          <td id="LC303" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">new</span> <span class="pl-v">MergeDuplicateChunksPlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L304" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="304"></td>
          <td id="LC304" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L305" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="305"></td>
          <td id="LC305" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">flagIncludedChunks</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L306" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="306"></td>
          <td id="LC306" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">const</span> <span class="pl-v">FlagIncludedChunksPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./optimize/FlagIncludedChunksPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L307" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="307"></td>
          <td id="LC307" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">new</span> <span class="pl-v">FlagIncludedChunksPlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L308" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="308"></td>
          <td id="LC308" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L309" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="309"></td>
          <td id="LC309" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">sideEffects</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L310" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="310"></td>
          <td id="LC310" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">const</span> <span class="pl-v">SideEffectsFlagPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./optimize/SideEffectsFlagPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L311" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="311"></td>
          <td id="LC311" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">new</span> <span class="pl-v">SideEffectsFlagPlugin</span><span class="pl-kos">(</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L312" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="312"></td>
          <td id="LC312" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">sideEffects</span> <span class="pl-c1">===</span> <span class="pl-c1">true</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L313" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="313"></td>
          <td id="LC313" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L314" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="314"></td>
          <td id="LC314" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L315" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="315"></td>
          <td id="LC315" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">providedExports</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L316" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="316"></td>
          <td id="LC316" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">const</span> <span class="pl-v">FlagDependencyExportsPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./FlagDependencyExportsPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L317" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="317"></td>
          <td id="LC317" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">new</span> <span class="pl-v">FlagDependencyExportsPlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L318" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="318"></td>
          <td id="LC318" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L319" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="319"></td>
          <td id="LC319" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">usedExports</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L320" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="320"></td>
          <td id="LC320" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">const</span> <span class="pl-v">FlagDependencyUsagePlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./FlagDependencyUsagePlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L321" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="321"></td>
          <td id="LC321" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">new</span> <span class="pl-v">FlagDependencyUsagePlugin</span><span class="pl-kos">(</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L322" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="322"></td>
          <td id="LC322" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">usedExports</span> <span class="pl-c1">===</span> <span class="pl-s">"global"</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L323" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="323"></td>
          <td id="LC323" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L324" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="324"></td>
          <td id="LC324" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L325" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="325"></td>
          <td id="LC325" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">innerGraph</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L326" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="326"></td>
          <td id="LC326" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">const</span> <span class="pl-v">InnerGraphPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./optimize/InnerGraphPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L327" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="327"></td>
          <td id="LC327" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">new</span> <span class="pl-v">InnerGraphPlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L328" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="328"></td>
          <td id="LC328" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L329" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="329"></td>
          <td id="LC329" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">mangleExports</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L330" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="330"></td>
          <td id="LC330" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">const</span> <span class="pl-v">MangleExportsPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./optimize/MangleExportsPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L331" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="331"></td>
          <td id="LC331" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">new</span> <span class="pl-v">MangleExportsPlugin</span><span class="pl-kos">(</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L332" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="332"></td>
          <td id="LC332" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">mangleExports</span> <span class="pl-c1">!==</span> <span class="pl-s">"size"</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L333" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="333"></td>
          <td id="LC333" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L334" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="334"></td>
          <td id="LC334" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L335" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="335"></td>
          <td id="LC335" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">concatenateModules</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L336" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="336"></td>
          <td id="LC336" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">const</span> <span class="pl-v">ModuleConcatenationPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./optimize/ModuleConcatenationPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L337" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="337"></td>
          <td id="LC337" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">new</span> <span class="pl-v">ModuleConcatenationPlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L338" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="338"></td>
          <td id="LC338" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L339" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="339"></td>
          <td id="LC339" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">splitChunks</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L340" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="340"></td>
          <td id="LC340" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">const</span> <span class="pl-v">SplitChunksPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./optimize/SplitChunksPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L341" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="341"></td>
          <td id="LC341" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">new</span> <span class="pl-v">SplitChunksPlugin</span><span class="pl-kos">(</span><span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">splitChunks</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L342" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="342"></td>
          <td id="LC342" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L343" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="343"></td>
          <td id="LC343" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">runtimeChunk</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L344" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="344"></td>
          <td id="LC344" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">const</span> <span class="pl-v">RuntimeChunkPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./optimize/RuntimeChunkPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L345" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="345"></td>
          <td id="LC345" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">new</span> <span class="pl-v">RuntimeChunkPlugin</span><span class="pl-kos">(</span><span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">runtimeChunk</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L346" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="346"></td>
          <td id="LC346" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L347" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="347"></td>
          <td id="LC347" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">emitOnErrors</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L348" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="348"></td>
          <td id="LC348" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">const</span> <span class="pl-v">NoEmitOnErrorsPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./NoEmitOnErrorsPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L349" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="349"></td>
          <td id="LC349" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">new</span> <span class="pl-v">NoEmitOnErrorsPlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L350" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="350"></td>
          <td id="LC350" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L351" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="351"></td>
          <td id="LC351" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">realContentHash</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L352" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="352"></td>
          <td id="LC352" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">const</span> <span class="pl-v">RealContentHashPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./optimize/RealContentHashPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L353" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="353"></td>
          <td id="LC353" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">new</span> <span class="pl-v">RealContentHashPlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L354" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="354"></td>
          <td id="LC354" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-c1">hashFunction</span>: <span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">output</span><span class="pl-kos">.</span><span class="pl-c1">hashFunction</span><span class="pl-kos">,</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L355" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="355"></td>
          <td id="LC355" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-c1">hashDigest</span>: <span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">output</span><span class="pl-kos">.</span><span class="pl-c1">hashDigest</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L356" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="356"></td>
          <td id="LC356" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L357" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="357"></td>
          <td id="LC357" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L358" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="358"></td>
          <td id="LC358" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">checkWasmTypes</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L359" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="359"></td>
          <td id="LC359" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">const</span> <span class="pl-v">WasmFinalizeExportsPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./wasm-sync/WasmFinalizeExportsPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L360" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="360"></td>
          <td id="LC360" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">new</span> <span class="pl-v">WasmFinalizeExportsPlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L361" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="361"></td>
          <td id="LC361" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L362" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="362"></td>
          <td id="LC362" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-s1">moduleIds</span> <span class="pl-c1">=</span> <span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">moduleIds</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L363" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="363"></td>
          <td id="LC363" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">moduleIds</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L364" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="364"></td>
          <td id="LC364" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">switch</span> <span class="pl-kos">(</span><span class="pl-s1">moduleIds</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L365" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="365"></td>
          <td id="LC365" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-k">case</span> <span class="pl-s">"natural"</span>: <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L366" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="366"></td>
          <td id="LC366" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">const</span> <span class="pl-v">NaturalModuleIdsPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./ids/NaturalModuleIdsPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L367" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="367"></td>
          <td id="LC367" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">new</span> <span class="pl-v">NaturalModuleIdsPlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L368" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="368"></td>
          <td id="LC368" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">break</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L369" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="369"></td>
          <td id="LC369" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L370" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="370"></td>
          <td id="LC370" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-k">case</span> <span class="pl-s">"named"</span>: <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L371" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="371"></td>
          <td id="LC371" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">const</span> <span class="pl-v">NamedModuleIdsPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./ids/NamedModuleIdsPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L372" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="372"></td>
          <td id="LC372" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">new</span> <span class="pl-v">NamedModuleIdsPlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L373" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="373"></td>
          <td id="LC373" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">break</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L374" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="374"></td>
          <td id="LC374" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L375" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="375"></td>
          <td id="LC375" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-k">case</span> <span class="pl-s">"hashed"</span>: <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L376" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="376"></td>
          <td id="LC376" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">const</span> <span class="pl-v">WarnDeprecatedOptionPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./WarnDeprecatedOptionPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L377" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="377"></td>
          <td id="LC377" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">const</span> <span class="pl-v">HashedModuleIdsPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./ids/HashedModuleIdsPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L378" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="378"></td>
          <td id="LC378" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">new</span> <span class="pl-v">WarnDeprecatedOptionPlugin</span><span class="pl-kos">(</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L379" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="379"></td>
          <td id="LC379" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 				<span class="pl-s">"optimization.moduleIds"</span><span class="pl-kos">,</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L380" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="380"></td>
          <td id="LC380" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 				<span class="pl-s">"hashed"</span><span class="pl-kos">,</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L381" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="381"></td>
          <td id="LC381" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 				<span class="pl-s">"deterministic"</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L382" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="382"></td>
          <td id="LC382" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L383" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="383"></td>
          <td id="LC383" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">new</span> <span class="pl-v">HashedModuleIdsPlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L384" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="384"></td>
          <td id="LC384" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">break</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L385" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="385"></td>
          <td id="LC385" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L386" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="386"></td>
          <td id="LC386" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-k">case</span> <span class="pl-s">"deterministic"</span>: <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L387" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="387"></td>
          <td id="LC387" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">const</span> <span class="pl-v">DeterministicModuleIdsPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./ids/DeterministicModuleIdsPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L388" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="388"></td>
          <td id="LC388" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">new</span> <span class="pl-v">DeterministicModuleIdsPlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L389" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="389"></td>
          <td id="LC389" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">break</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L390" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="390"></td>
          <td id="LC390" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L391" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="391"></td>
          <td id="LC391" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-k">case</span> <span class="pl-s">"size"</span>: <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L392" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="392"></td>
          <td id="LC392" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">const</span> <span class="pl-v">OccurrenceModuleIdsPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./ids/OccurrenceModuleIdsPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L393" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="393"></td>
          <td id="LC393" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">new</span> <span class="pl-v">OccurrenceModuleIdsPlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L394" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="394"></td>
          <td id="LC394" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 				<span class="pl-c1">prioritiseInitial</span>: <span class="pl-c1">true</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L395" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="395"></td>
          <td id="LC395" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L396" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="396"></td>
          <td id="LC396" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">break</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L397" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="397"></td>
          <td id="LC397" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L398" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="398"></td>
          <td id="LC398" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-k">default</span>: </td>
        </tr>

        <tr class="border-0">
          <td id="L399" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="399"></td>
          <td id="LC399" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-v">Error</span><span class="pl-kos">(</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L400" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="400"></td>
          <td id="LC400" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 				<span class="pl-s">`webpack bug: moduleIds: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">moduleIds</span><span class="pl-kos">}</span></span> is not implemented`</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L401" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="401"></td>
          <td id="LC401" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L402" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="402"></td>
          <td id="LC402" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L403" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="403"></td>
          <td id="LC403" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L404" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="404"></td>
          <td id="LC404" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">const</span> <span class="pl-s1">chunkIds</span> <span class="pl-c1">=</span> <span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">chunkIds</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L405" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="405"></td>
          <td id="LC405" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">chunkIds</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L406" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="406"></td>
          <td id="LC406" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">switch</span> <span class="pl-kos">(</span><span class="pl-s1">chunkIds</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L407" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="407"></td>
          <td id="LC407" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-k">case</span> <span class="pl-s">"natural"</span>: <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L408" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="408"></td>
          <td id="LC408" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">const</span> <span class="pl-v">NaturalChunkIdsPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./ids/NaturalChunkIdsPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L409" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="409"></td>
          <td id="LC409" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">new</span> <span class="pl-v">NaturalChunkIdsPlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L410" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="410"></td>
          <td id="LC410" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">break</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L411" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="411"></td>
          <td id="LC411" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L412" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="412"></td>
          <td id="LC412" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-k">case</span> <span class="pl-s">"named"</span>: <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L413" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="413"></td>
          <td id="LC413" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">const</span> <span class="pl-v">NamedChunkIdsPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./ids/NamedChunkIdsPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L414" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="414"></td>
          <td id="LC414" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">new</span> <span class="pl-v">NamedChunkIdsPlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L415" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="415"></td>
          <td id="LC415" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">break</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L416" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="416"></td>
          <td id="LC416" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L417" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="417"></td>
          <td id="LC417" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-k">case</span> <span class="pl-s">"deterministic"</span>: <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L418" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="418"></td>
          <td id="LC418" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">const</span> <span class="pl-v">DeterministicChunkIdsPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./ids/DeterministicChunkIdsPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L419" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="419"></td>
          <td id="LC419" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">new</span> <span class="pl-v">DeterministicChunkIdsPlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L420" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="420"></td>
          <td id="LC420" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">break</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L421" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="421"></td>
          <td id="LC421" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L422" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="422"></td>
          <td id="LC422" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-k">case</span> <span class="pl-s">"size"</span>: <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L423" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="423"></td>
          <td id="LC423" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">const</span> <span class="pl-v">OccurrenceChunkIdsPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./ids/OccurrenceChunkIdsPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L424" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="424"></td>
          <td id="LC424" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">new</span> <span class="pl-v">OccurrenceChunkIdsPlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L425" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="425"></td>
          <td id="LC425" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 				<span class="pl-c1">prioritiseInitial</span>: <span class="pl-c1">true</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L426" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="426"></td>
          <td id="LC426" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L427" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="427"></td>
          <td id="LC427" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">break</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L428" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="428"></td>
          <td id="LC428" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L429" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="429"></td>
          <td id="LC429" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-k">case</span> <span class="pl-s">"total-size"</span>: <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L430" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="430"></td>
          <td id="LC430" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">const</span> <span class="pl-v">OccurrenceChunkIdsPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./ids/OccurrenceChunkIdsPlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L431" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="431"></td>
          <td id="LC431" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">new</span> <span class="pl-v">OccurrenceChunkIdsPlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L432" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="432"></td>
          <td id="LC432" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 				<span class="pl-c1">prioritiseInitial</span>: <span class="pl-c1">false</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L433" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="433"></td>
          <td id="LC433" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L434" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="434"></td>
          <td id="LC434" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">break</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L435" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="435"></td>
          <td id="LC435" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L436" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="436"></td>
          <td id="LC436" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-k">default</span>: </td>
        </tr>

        <tr class="border-0">
          <td id="L437" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="437"></td>
          <td id="LC437" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-v">Error</span><span class="pl-kos">(</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L438" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="438"></td>
          <td id="LC438" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 				<span class="pl-s">`webpack bug: chunkIds: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">chunkIds</span><span class="pl-kos">}</span></span> is not implemented`</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L439" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="439"></td>
          <td id="LC439" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L440" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="440"></td>
          <td id="LC440" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L441" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="441"></td>
          <td id="LC441" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L442" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="442"></td>
          <td id="LC442" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">nodeEnv</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L443" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="443"></td>
          <td id="LC443" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">const</span> <span class="pl-v">DefinePlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"./DefinePlugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L444" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="444"></td>
          <td id="LC444" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">new</span> <span class="pl-v">DefinePlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L445" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="445"></td>
          <td id="LC445" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-s">"process.env.NODE_ENV"</span>: <span class="pl-c1">JSON</span><span class="pl-kos">.</span><span class="pl-en">stringify</span><span class="pl-kos">(</span><span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">nodeEnv</span><span class="pl-kos">)</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L446" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="446"></td>
          <td id="LC446" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L447" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="447"></td>
          <td id="LC447" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L448" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="448"></td>
          <td id="LC448" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">minimize</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L449" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="449"></td>
          <td id="LC449" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-k">const</span> <span class="pl-s1">minimizer</span> <span class="pl-k">of</span> <span class="pl-s1">options</span><span class="pl-kos">.</span><span class="pl-c1">optimization</span><span class="pl-kos">.</span><span class="pl-c1">minimizer</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L450" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="450"></td>
          <td id="LC450" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-k">typeof</span> <span class="pl-s1">minimizer</span> <span class="pl-c1">===</span> <span class="pl-s">"function"</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L451" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="451"></td>
          <td id="LC451" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-s1">minimizer</span><span class="pl-kos">.</span><span class="pl-en">call</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">,</span> <span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L452" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="452"></td>
          <td id="LC452" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">minimizer</span> <span class="pl-c1">!==</span> <span class="pl-s">"..."</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L453" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="453"></td>
          <td id="LC453" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 			<span class="pl-s1">minimizer</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">compiler</span><span class="pl-kos">)</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L454" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="454"></td>
          <td id="LC454" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 		<span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L455" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="455"></td>
          <td id="LC455" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> 	<span class="pl-kos">}</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L456" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="456"></td>
          <td id="LC456" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
        </tr>
    </tbody></table>
  </div>
</div>
 is doing into my child compiler. Otherwise, I have to duplicate the whole block and then paste it into my plugin.<p></p>
<p dir="auto"><strong>What is motivation or use case for adding/changing the behavior?</strong><br>
Same as previous.</p>
<p dir="auto"><strong>How should this be implemented in your opinion?</strong><br>
Just put the whole block in a function and then expose it.</p>
<p dir="auto"><strong>Are you willing to work on this yourself?</strong><br>
yes</p>
<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong></p>
<p dir="auto">Bug</p>


<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">ContextReplace seems to cause duplicate (Wasted) rebuilds in watch mode.</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>



<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">A single build and then subsequent builds upon file change.</p>
<p dir="auto"><strong>If this is a feature request, what is motivation or use case for changing the behavior?</strong></p>
<p dir="auto"><strong>Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.</strong></p>
<p dir="auto">Here is a log output demonstrating the secondary build at the end.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt; webpack --watch --progress --display-error-details

  0% compiling
Webpack is watching the files…


 10% building modules 0/2 modules 2 active ...ate\entries\coreEntryInstanceAdmin.js
 10% building modules 2/2 modules 0 active
 10% building modules 2/3 modules 1 active ...apps\instance\coreAppInstanceAdmin.js
 10% building modules 2/4 modules 2 active ...e\apps\instance\coreAppInstanceWww.js
 10% building modules 4/4 modules 0 active
 10% building modules 4/6 modules 2 active ...Project\core\private\lib\coreMixin.js
 10% building modules 4/8 modules 4 active ...e\private\apps\base\coreAppBaseWww.js
 10% building modules 8/8 modules 0 active
 10% building modules 8/10 modules 2 active ...scss\themes\instance\admin\theme.scss
 11% building modules 10/11 modules 1 active ...core\private\apps\base\coreAppBase.js
 11% building modules 10/12 modules 2 active ...scss\themes\instance\admin\theme.scss
 11% building modules 10/19 modules 9 active ...core\private\modules\coreApi\index.js
 11% building modules 11/19 modules 8 active ...core\private\modules\coreApi\index.js
 11% building modules 11/21 modules 10 active ...\1Loader[A-Z0-9][a-zA-Z0-9-_]*\.js$)/
 11% building modules 13/21 modules 8 active ...\1Loader[A-Z0-9][a-zA-Z0-9-_]*\.js$)/
 11% building modules 14/21 modules 7 active ...\1Loader[A-Z0-9][a-zA-Z0-9-_]*\.js$)/
 11% building modules 15/21 modules 6 active ...\1Loader[A-Z0-9][a-zA-Z0-9-_]*\.js$)/
 11% building modules 16/21 modules 5 active ...\1Loader[A-Z0-9][a-zA-Z0-9-_]*\.js$)/
 12% building modules 17/21 modules 4 active ...\1Loader[A-Z0-9][a-zA-Z0-9-_]*\.js$)/
 12% building modules 17/22 modules 5 active ...vestergaard-company\js-mixin\index.js
 12% building modules 18/25 modules 7 active ...roject\core\private\lib\coreLoader.js
 12% building modules 18/27 modules 9 active ...hahnamaProject\core\lib\coreShared.js
 12% building modules 19/27 modules 8 active ...hahnamaProject\core\lib\coreShared.js
 12% building modules 22/27 modules 5 active ...hahnamaProject\core\lib\coreShared.js
 12% building modules 22/29 modules 7 active ...t\core\private\templates\coreMenu.pug
 12% building modules 23/29 modules 6 active ...t\core\private\templates\coreMenu.pug
 12% building modules 24/29 modules 5 active ...t\core\private\templates\coreMenu.pug
 12% building modules 24/30 modules 6 active ...t\core\private\lib\coreReadyTarget.js
 13% building modules 25/36 modules 11 active ...rd-company\js-mixin\src\Utils\wrap.js
 13% building modules 28/37 modules 9 active ...ect\node_modules\pug-runtime\index.js
 13% building modules 30/37 modules 7 active ...ect\node_modules\pug-runtime\index.js
 13% building modules 33/39 modules 6 active ...node_modules\bootstrap\dist\js\npm.js
 14% building modules 35/41 modules 6 active ...mixins\shared\coreMixinSharedMenu.pug
 14% building modules 37/43 modules 6 active ...generic\coreLoaderGenericListItems.js
 14% building modules 37/45 modules 8 active ...oreComponentFormInputSelect\loader.js
 14% building modules 37/46 modules 9 active ...oaders\coreLoaderFeatureTestWicked.js
 14% building modules 38/46 modules 8 active ...oaders\coreLoaderFeatureTestWicked.js
 14% building modules 39/46 modules 7 active ...oaders\coreLoaderFeatureTestWicked.js
 14% building modules 40/46 modules 6 active ...oaders\coreLoaderFeatureTestWicked.js
 14% building modules 40/47 modules 7 active ...ct\node_modules\jquery\dist\jquery.js
 14% building modules 41/47 modules 6 active ...oaders\coreLoaderFeatureTestWicked.js
 15% building modules 42/49 modules 7 active ...ct\node_modules\jquery\dist\jquery.js
 15% building modules 42/51 modules 9 active ...ct\node_modules\bootstrap\js\alert.js
 15% building modules 42/61 modules 19 active ...ct\node_modules\bootstrap\js\affix.js
 15% building modules 43/61 modules 18 active ...ct\node_modules\bootstrap\js\affix.js
 15% building modules 46/62 modules 16 active ...oject\node_modules\debug\src\debug.js
 15% building modules 46/63 modules 17 active ...oject\node_modules\process\browser.js
 15% building modules 49/63 modules 14 active ...oject\node_modules\process\browser.js
 16% building modules 50/63 modules 13 active ...oject\node_modules\process\browser.js
 16% building modules 51/63 modules 12 active ...oject\node_modules\process\browser.js
 16% building modules 52/63 modules 11 active ...oject\node_modules\process\browser.js
 16% building modules 53/63 modules 10 active ...oject\node_modules\process\browser.js
 16% building modules 54/63 modules 9 active ...oject\node_modules\process\browser.js
 16% building modules 55/63 modules 8 active ...oject\node_modules\process\browser.js
 16% building modules 56/63 modules 7 active ...oject\node_modules\process\browser.js
 16% building modules 57/63 modules 6 active ...oject\node_modules\process\browser.js
 16% building modules 58/63 modules 5 active ...oject\node_modules\process\browser.js
 17% building modules 60/63 modules 3 active ...oject\node_modules\process\browser.js
 17% building modules 62/65 modules 3 active ...ode_modules\webpack\buildin\global.js
 17% building modules 64/68 modules 4 active ...eComponentFormInputSelect\styles.scss
 17% building modules 64/70 modules 6 active ...reComponentFormInputSelect\mixins.pug
 18% building modules 67/71 modules 4 active ...hnamaProject\node_modules\ms\index.js
 18% building modules 67/73 modules 6 active ...re\templates\mixins\coreMixinForm.pug
 18% building modules 71/76 modules 5 active ..._modules\select2\dist\css\select2.css
 18% building modules 72/76 modules 4 active ..._modules\select2\dist\css\select2.css
 18% building modules 73/76 modules 3 active ..._modules\select2\dist\css\select2.css
 18% building modules 74/76 modules 2 active ...e\scss\themes\instance\www\theme.scss
 19% building modules 75/76 modules 1 active ...scss\themes\instance\admin\theme.scss
 19% building modules 76/77 modules 1 active ..._modules\css-loader\lib\url\escape.js
 19% building modules 77/77 modules 0 active
 19% building modules 77/83 modules 6 active ...fonts\fontawesome-webfont.ttf?v=4.7.0
 19% building modules 78/83 modules 5 active ...fonts\fontawesome-webfont.ttf?v=4.7.0
 19% building modules 79/83 modules 4 active ...fonts\fontawesome-webfont.ttf?v=4.7.0
 19% building modules 80/83 modules 3 active ...fonts\fontawesome-webfont.ttf?v=4.7.0
 19% building modules 82/83 modules 1 active ...fonts\fontawesome-webfont.svg?v=4.7.0
 71% sealing
 74% module optimization
 75% advanced module optimization
 76% basic chunk optimization pass 2
 19% building modules 83/84 modules 1 active ...e\scss\themes\instance\www\theme.scss
 19% building modules 83/85 modules 2 active ...scss\themes\instance\admin\theme.scss
 20% building modules 84/85 modules 1 active ...e\scss\themes\instance\www\theme.scss
 85% chunk reviving
 87% chunk id optimization
 90% chunk assets processing
 95% emittingHash: 4c1f5b159f459c5c35b4

Version: webpack 3.10.0
Time: 4648ms
                                                           Asset       Size  Chunks                    Chunk Names
                                             js/loader2.chunk.js   81 bytes       2  [emitted]         loader2
  fonts/fontawesome-webfont.674f50d287a8c48dc19ba404d20fe713.eot     166 kB          [emitted]         
 fonts/fontawesome-webfont.fee66e712a8a08eef5805a46892932ad.woff      98 kB          [emitted]         
  fonts/fontawesome-webfont.b06871f281fee6b241d60582ae9369b9.ttf     166 kB          [emitted]         
  fonts/fontawesome-webfont.912ec66d7572ff821749319396470bde.svg     444 kB          [emitted]  [big]  
                                             js/loader1.chunk.js     181 kB       0  [emitted]         loader1
                                             js/loader3.chunk.js    2.05 kB       1  [emitted]         loader3
fonts/fontawesome-webfont.af7ae505a9eed503f8b8e6982036873e.woff2    77.2 kB          [emitted]         
                                             js/loader0.chunk.js  743 bytes       3  [emitted]         loader0
                                     js/instance.admin.bundle.js    2.53 kB       4  [emitted]         instance.admin
                                       js/instance.www.bundle.js    1.69 kB       5  [emitted]         instance.www
                                             js/vendor.bundle.js     482 kB       6  [emitted]  [big]  vendor.bundle
                                     css/instance.www.bundle.css     466 kB       5  [emitted]  [big]  instance.www
                                   css/instance.admin.bundle.css     466 kB       4  [emitted]  [big]  instance.admin
   [4] ./lib/coreMixin.js 258 bytes {6} [built]
  [10] ./apps/base/coreAppBaseWww.js 861 bytes {6} [built]
  [14] ./templates/coreMenu.pug 8.96 kB {6} [built]
  [15] ./apps/instance/coreAppInstance.js 283 bytes {6} [built]
  [19] ./entries/coreEntryInstanceWww.js 213 bytes {5} [built]
  [20] ./scss/themes/instance/www/theme.scss 41 bytes {5} [built]
  [22] ./apps/instance/coreAppInstanceWww.js 358 bytes {5} [built]
  [27] ./apps/base/coreAppBase.js 3.67 kB {6} [built]
  [51] ./modules/coreForm/index.js 9.73 kB {6} [built]
  [53] ./entries/coreEntryInstanceAdmin.js 217 bytes {4} [built]
  [54] ./scss/themes/instance/admin/theme.scss 41 bytes {4} [built]
  [55] ./apps/instance/coreAppInstanceAdmin.js 368 bytes {4} [built]
  [56] ./apps/base/coreAppBaseAdmin.js 384 bytes {4} [built]
  [81] D:/dev/projects/nodejs/shahnamaProject/node_modules/css-loader!D:/dev/projects/nodejs/shahnamaProject/node_modules/resolve-url-loader!D:/dev/projects/nodejs/shahnamaProject/node_modules/sass-loader/lib/loader.js?&amp;precision=10!./scss/themes/instance/www/theme.scss 496 kB [built]
  [82] D:/dev/projects/nodejs/shahnamaProject/node_modules/css-loader!D:/dev/projects/nodejs/shahnamaProject/node_modules/resolve-url-loader!D:/dev/projects/nodejs/shahnamaProject/node_modules/sass-loader/lib/loader.js?&amp;precision=10!./scss/themes/instance/admin/theme.scss 496 kB [built]
    + 68 hidden modules
Child extract-text-webpack-plugin ../../node_modules/extract-text-webpack-plugin/dist ../../node_modules/css-loader/index.js!../../node_modules/resolve-url-loader/index.js!../../node_modules/sass-loader/lib/loader.js?&amp;precision=10!scss/themes/instance/admin/theme.scss:
     5 assets
       [0] D:/dev/projects/nodejs/shahnamaProject/node_modules/css-loader!D:/dev/projects/nodejs/shahnamaProject/node_modules/resolve-url-loader!D:/dev/projects/nodejs/shahnamaProject/node_modules/sass-loader/lib/loader.js?&amp;precision=10!./scss/themes/instance/admin/theme.scss 496 kB {0} [built]
        + 8 hidden modules
Child extract-text-webpack-plugin ../../node_modules/extract-text-webpack-plugin/dist ../../node_modules/css-loader/index.js!../../node_modules/resolve-url-loader/index.js!../../node_modules/sass-loader/lib/loader.js?&amp;precision=10!scss/themes/instance/www/theme.scss:
     5 assets
       [0] D:/dev/projects/nodejs/shahnamaProject/node_modules/css-loader!D:/dev/projects/nodejs/shahnamaProject/node_modules/resolve-url-loader!D:/dev/projects/nodejs/shahnamaProject/node_modules/sass-loader/lib/loader.js?&amp;precision=10!./scss/themes/instance/www/theme.scss 496 kB {0} [built]
        + 8 hidden modules
 10% building modules 0/1 modules 1 active ...\1Loader[A-Z0-9][a-zA-Z0-9-_]*\.js$)/
 10% building modules 1/2 modules 1 active ...ComponentFormInputReference\loader.js
 86% chunk order optimization
 87% chunk id optimization
 88% hashing
 95% emitting
Hash: 54257b4d40c1dff4ccc9
Version: webpack 3.10.0
Time: 21889ms
                        Asset    Size  Chunks                    Chunk Names
          js/loader1.chunk.js  197 kB       0  [emitted]         loader1
          js/vendor.bundle.js  465 kB       6  [emitted]  [big]  vendor.bundle
  css/instance.www.bundle.css  466 kB       5  [emitted]  [big]  instance.www
css/instance.admin.bundle.css  466 kB       4  [emitted]  [big]  instance.admin
 + 5 hidden assets
  [34] D:/dev/projects/nodejs/shahnamaProject lazy [\/\\](core|instance)[\/\\](?:(?:components|features[\/\\].*[\/\\]components)[\/\\].*\1Component[a-zA-Z0-9]*[\/\\]loader\.js$|(?:private|features[\/\\][a-zA-Z0-9-_]*)[\/\\](?:[a-zA-Z0-9-_]*[\/\\])*loaders[\/\\](?:[a-zA-Z0-9-_]*[\/\\])*\1Loader[A-Z0-9][a-zA-Z0-9-_]*\.js$) 160 bytes {6} [built]
    + 70 hidden modules"><pre class="notranslate"><code class="notranslate">&gt; webpack --watch --progress --display-error-details

  0% compiling
Webpack is watching the files…


 10% building modules 0/2 modules 2 active ...ate\entries\coreEntryInstanceAdmin.js
 10% building modules 2/2 modules 0 active
 10% building modules 2/3 modules 1 active ...apps\instance\coreAppInstanceAdmin.js
 10% building modules 2/4 modules 2 active ...e\apps\instance\coreAppInstanceWww.js
 10% building modules 4/4 modules 0 active
 10% building modules 4/6 modules 2 active ...Project\core\private\lib\coreMixin.js
 10% building modules 4/8 modules 4 active ...e\private\apps\base\coreAppBaseWww.js
 10% building modules 8/8 modules 0 active
 10% building modules 8/10 modules 2 active ...scss\themes\instance\admin\theme.scss
 11% building modules 10/11 modules 1 active ...core\private\apps\base\coreAppBase.js
 11% building modules 10/12 modules 2 active ...scss\themes\instance\admin\theme.scss
 11% building modules 10/19 modules 9 active ...core\private\modules\coreApi\index.js
 11% building modules 11/19 modules 8 active ...core\private\modules\coreApi\index.js
 11% building modules 11/21 modules 10 active ...\1Loader[A-Z0-9][a-zA-Z0-9-_]*\.js$)/
 11% building modules 13/21 modules 8 active ...\1Loader[A-Z0-9][a-zA-Z0-9-_]*\.js$)/
 11% building modules 14/21 modules 7 active ...\1Loader[A-Z0-9][a-zA-Z0-9-_]*\.js$)/
 11% building modules 15/21 modules 6 active ...\1Loader[A-Z0-9][a-zA-Z0-9-_]*\.js$)/
 11% building modules 16/21 modules 5 active ...\1Loader[A-Z0-9][a-zA-Z0-9-_]*\.js$)/
 12% building modules 17/21 modules 4 active ...\1Loader[A-Z0-9][a-zA-Z0-9-_]*\.js$)/
 12% building modules 17/22 modules 5 active ...vestergaard-company\js-mixin\index.js
 12% building modules 18/25 modules 7 active ...roject\core\private\lib\coreLoader.js
 12% building modules 18/27 modules 9 active ...hahnamaProject\core\lib\coreShared.js
 12% building modules 19/27 modules 8 active ...hahnamaProject\core\lib\coreShared.js
 12% building modules 22/27 modules 5 active ...hahnamaProject\core\lib\coreShared.js
 12% building modules 22/29 modules 7 active ...t\core\private\templates\coreMenu.pug
 12% building modules 23/29 modules 6 active ...t\core\private\templates\coreMenu.pug
 12% building modules 24/29 modules 5 active ...t\core\private\templates\coreMenu.pug
 12% building modules 24/30 modules 6 active ...t\core\private\lib\coreReadyTarget.js
 13% building modules 25/36 modules 11 active ...rd-company\js-mixin\src\Utils\wrap.js
 13% building modules 28/37 modules 9 active ...ect\node_modules\pug-runtime\index.js
 13% building modules 30/37 modules 7 active ...ect\node_modules\pug-runtime\index.js
 13% building modules 33/39 modules 6 active ...node_modules\bootstrap\dist\js\npm.js
 14% building modules 35/41 modules 6 active ...mixins\shared\coreMixinSharedMenu.pug
 14% building modules 37/43 modules 6 active ...generic\coreLoaderGenericListItems.js
 14% building modules 37/45 modules 8 active ...oreComponentFormInputSelect\loader.js
 14% building modules 37/46 modules 9 active ...oaders\coreLoaderFeatureTestWicked.js
 14% building modules 38/46 modules 8 active ...oaders\coreLoaderFeatureTestWicked.js
 14% building modules 39/46 modules 7 active ...oaders\coreLoaderFeatureTestWicked.js
 14% building modules 40/46 modules 6 active ...oaders\coreLoaderFeatureTestWicked.js
 14% building modules 40/47 modules 7 active ...ct\node_modules\jquery\dist\jquery.js
 14% building modules 41/47 modules 6 active ...oaders\coreLoaderFeatureTestWicked.js
 15% building modules 42/49 modules 7 active ...ct\node_modules\jquery\dist\jquery.js
 15% building modules 42/51 modules 9 active ...ct\node_modules\bootstrap\js\alert.js
 15% building modules 42/61 modules 19 active ...ct\node_modules\bootstrap\js\affix.js
 15% building modules 43/61 modules 18 active ...ct\node_modules\bootstrap\js\affix.js
 15% building modules 46/62 modules 16 active ...oject\node_modules\debug\src\debug.js
 15% building modules 46/63 modules 17 active ...oject\node_modules\process\browser.js
 15% building modules 49/63 modules 14 active ...oject\node_modules\process\browser.js
 16% building modules 50/63 modules 13 active ...oject\node_modules\process\browser.js
 16% building modules 51/63 modules 12 active ...oject\node_modules\process\browser.js
 16% building modules 52/63 modules 11 active ...oject\node_modules\process\browser.js
 16% building modules 53/63 modules 10 active ...oject\node_modules\process\browser.js
 16% building modules 54/63 modules 9 active ...oject\node_modules\process\browser.js
 16% building modules 55/63 modules 8 active ...oject\node_modules\process\browser.js
 16% building modules 56/63 modules 7 active ...oject\node_modules\process\browser.js
 16% building modules 57/63 modules 6 active ...oject\node_modules\process\browser.js
 16% building modules 58/63 modules 5 active ...oject\node_modules\process\browser.js
 17% building modules 60/63 modules 3 active ...oject\node_modules\process\browser.js
 17% building modules 62/65 modules 3 active ...ode_modules\webpack\buildin\global.js
 17% building modules 64/68 modules 4 active ...eComponentFormInputSelect\styles.scss
 17% building modules 64/70 modules 6 active ...reComponentFormInputSelect\mixins.pug
 18% building modules 67/71 modules 4 active ...hnamaProject\node_modules\ms\index.js
 18% building modules 67/73 modules 6 active ...re\templates\mixins\coreMixinForm.pug
 18% building modules 71/76 modules 5 active ..._modules\select2\dist\css\select2.css
 18% building modules 72/76 modules 4 active ..._modules\select2\dist\css\select2.css
 18% building modules 73/76 modules 3 active ..._modules\select2\dist\css\select2.css
 18% building modules 74/76 modules 2 active ...e\scss\themes\instance\www\theme.scss
 19% building modules 75/76 modules 1 active ...scss\themes\instance\admin\theme.scss
 19% building modules 76/77 modules 1 active ..._modules\css-loader\lib\url\escape.js
 19% building modules 77/77 modules 0 active
 19% building modules 77/83 modules 6 active ...fonts\fontawesome-webfont.ttf?v=4.7.0
 19% building modules 78/83 modules 5 active ...fonts\fontawesome-webfont.ttf?v=4.7.0
 19% building modules 79/83 modules 4 active ...fonts\fontawesome-webfont.ttf?v=4.7.0
 19% building modules 80/83 modules 3 active ...fonts\fontawesome-webfont.ttf?v=4.7.0
 19% building modules 82/83 modules 1 active ...fonts\fontawesome-webfont.svg?v=4.7.0
 71% sealing
 74% module optimization
 75% advanced module optimization
 76% basic chunk optimization pass 2
 19% building modules 83/84 modules 1 active ...e\scss\themes\instance\www\theme.scss
 19% building modules 83/85 modules 2 active ...scss\themes\instance\admin\theme.scss
 20% building modules 84/85 modules 1 active ...e\scss\themes\instance\www\theme.scss
 85% chunk reviving
 87% chunk id optimization
 90% chunk assets processing
 95% emittingHash: 4c1f5b159f459c5c35b4

Version: webpack 3.10.0
Time: 4648ms
                                                           Asset       Size  Chunks                    Chunk Names
                                             js/loader2.chunk.js   81 bytes       2  [emitted]         loader2
  fonts/fontawesome-webfont.674f50d287a8c48dc19ba404d20fe713.eot     166 kB          [emitted]         
 fonts/fontawesome-webfont.fee66e712a8a08eef5805a46892932ad.woff      98 kB          [emitted]         
  fonts/fontawesome-webfont.b06871f281fee6b241d60582ae9369b9.ttf     166 kB          [emitted]         
  fonts/fontawesome-webfont.912ec66d7572ff821749319396470bde.svg     444 kB          [emitted]  [big]  
                                             js/loader1.chunk.js     181 kB       0  [emitted]         loader1
                                             js/loader3.chunk.js    2.05 kB       1  [emitted]         loader3
fonts/fontawesome-webfont.af7ae505a9eed503f8b8e6982036873e.woff2    77.2 kB          [emitted]         
                                             js/loader0.chunk.js  743 bytes       3  [emitted]         loader0
                                     js/instance.admin.bundle.js    2.53 kB       4  [emitted]         instance.admin
                                       js/instance.www.bundle.js    1.69 kB       5  [emitted]         instance.www
                                             js/vendor.bundle.js     482 kB       6  [emitted]  [big]  vendor.bundle
                                     css/instance.www.bundle.css     466 kB       5  [emitted]  [big]  instance.www
                                   css/instance.admin.bundle.css     466 kB       4  [emitted]  [big]  instance.admin
   [4] ./lib/coreMixin.js 258 bytes {6} [built]
  [10] ./apps/base/coreAppBaseWww.js 861 bytes {6} [built]
  [14] ./templates/coreMenu.pug 8.96 kB {6} [built]
  [15] ./apps/instance/coreAppInstance.js 283 bytes {6} [built]
  [19] ./entries/coreEntryInstanceWww.js 213 bytes {5} [built]
  [20] ./scss/themes/instance/www/theme.scss 41 bytes {5} [built]
  [22] ./apps/instance/coreAppInstanceWww.js 358 bytes {5} [built]
  [27] ./apps/base/coreAppBase.js 3.67 kB {6} [built]
  [51] ./modules/coreForm/index.js 9.73 kB {6} [built]
  [53] ./entries/coreEntryInstanceAdmin.js 217 bytes {4} [built]
  [54] ./scss/themes/instance/admin/theme.scss 41 bytes {4} [built]
  [55] ./apps/instance/coreAppInstanceAdmin.js 368 bytes {4} [built]
  [56] ./apps/base/coreAppBaseAdmin.js 384 bytes {4} [built]
  [81] D:/dev/projects/nodejs/shahnamaProject/node_modules/css-loader!D:/dev/projects/nodejs/shahnamaProject/node_modules/resolve-url-loader!D:/dev/projects/nodejs/shahnamaProject/node_modules/sass-loader/lib/loader.js?&amp;precision=10!./scss/themes/instance/www/theme.scss 496 kB [built]
  [82] D:/dev/projects/nodejs/shahnamaProject/node_modules/css-loader!D:/dev/projects/nodejs/shahnamaProject/node_modules/resolve-url-loader!D:/dev/projects/nodejs/shahnamaProject/node_modules/sass-loader/lib/loader.js?&amp;precision=10!./scss/themes/instance/admin/theme.scss 496 kB [built]
    + 68 hidden modules
Child extract-text-webpack-plugin ../../node_modules/extract-text-webpack-plugin/dist ../../node_modules/css-loader/index.js!../../node_modules/resolve-url-loader/index.js!../../node_modules/sass-loader/lib/loader.js?&amp;precision=10!scss/themes/instance/admin/theme.scss:
     5 assets
       [0] D:/dev/projects/nodejs/shahnamaProject/node_modules/css-loader!D:/dev/projects/nodejs/shahnamaProject/node_modules/resolve-url-loader!D:/dev/projects/nodejs/shahnamaProject/node_modules/sass-loader/lib/loader.js?&amp;precision=10!./scss/themes/instance/admin/theme.scss 496 kB {0} [built]
        + 8 hidden modules
Child extract-text-webpack-plugin ../../node_modules/extract-text-webpack-plugin/dist ../../node_modules/css-loader/index.js!../../node_modules/resolve-url-loader/index.js!../../node_modules/sass-loader/lib/loader.js?&amp;precision=10!scss/themes/instance/www/theme.scss:
     5 assets
       [0] D:/dev/projects/nodejs/shahnamaProject/node_modules/css-loader!D:/dev/projects/nodejs/shahnamaProject/node_modules/resolve-url-loader!D:/dev/projects/nodejs/shahnamaProject/node_modules/sass-loader/lib/loader.js?&amp;precision=10!./scss/themes/instance/www/theme.scss 496 kB {0} [built]
        + 8 hidden modules
 10% building modules 0/1 modules 1 active ...\1Loader[A-Z0-9][a-zA-Z0-9-_]*\.js$)/
 10% building modules 1/2 modules 1 active ...ComponentFormInputReference\loader.js
 86% chunk order optimization
 87% chunk id optimization
 88% hashing
 95% emitting
Hash: 54257b4d40c1dff4ccc9
Version: webpack 3.10.0
Time: 21889ms
                        Asset    Size  Chunks                    Chunk Names
          js/loader1.chunk.js  197 kB       0  [emitted]         loader1
          js/vendor.bundle.js  465 kB       6  [emitted]  [big]  vendor.bundle
  css/instance.www.bundle.css  466 kB       5  [emitted]  [big]  instance.www
css/instance.admin.bundle.css  466 kB       4  [emitted]  [big]  instance.admin
 + 5 hidden assets
  [34] D:/dev/projects/nodejs/shahnamaProject lazy [\/\\](core|instance)[\/\\](?:(?:components|features[\/\\].*[\/\\]components)[\/\\].*\1Component[a-zA-Z0-9]*[\/\\]loader\.js$|(?:private|features[\/\\][a-zA-Z0-9-_]*)[\/\\](?:[a-zA-Z0-9-_]*[\/\\])*loaders[\/\\](?:[a-zA-Z0-9-_]*[\/\\])*\1Loader[A-Z0-9][a-zA-Z0-9-_]*\.js$) 160 bytes {6} [built]
    + 70 hidden modules
</code></pre></div>
<p dir="auto">I don't know if this is related to the webpack watcher triggering on files it generates? I have been trying for a few days now to resolve this issue but need some help.</p>
<p dir="auto"><strong>config</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="'use strict';

//module imports
const webpack = require('webpack');
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const MinifyPlugin = require(&quot;babel-minify-webpack-plugin&quot;);

//custom plugin imports
const IncludeExcludePlugin = require('./webpack/plugins/IncludeExcludePlugin.js');
const WatchOffsetPlugin = require('./webpack/plugins/WatchOffsetPlugin.js');
const CoreProtocolPlugin = require('./webpack/plugins/CoreProtocolPlugin.js');

//local imports
const apps = require('./core/coreApps');

//constants
const development = process.env.NODE_ENV === 'dev' || process.env.NODE_ENV === 'development';
const sassPrecision = 10;//this is important! precision fix detailed here: https://github.com/twbs/bootstrap-sass/issues/409

//build flags
const buildMaps = false;
const buildMonkeyApps = false;
const buildBabel = false;
const buildFonts = true;
const buildImages = true;
const buildLoaders = true;

//regexp patterns
const monkeyPattern = /external[\\\/]monkey[\\\/]([a-z0-9_-]+)[\\\/]app[\\\/]main.js$/i;
const monkeyDataPattern = /external[\\\/]monkey[\\\/]([a-z0-9_-]+)[\\\/]app[\\\/]data([a-z0-9-_@\\\/]*)[\\\/]([a-z0-9-_@]+\.(?:png|jpg|jpeg|gif|svg|txt|ttf|json))$/i;

//functions
function JavascriptEntryPoints() {
    const entries = {};

    //only include entry points enabled in teh config
    if (apps.instance.www.enabled) {
        entries['instance.www'] = './entries/coreEntryInstanceWww.js';
    }

    if (apps.instance.admin.enabled) {
        entries['instance.admin'] = './entries/coreEntryInstanceAdmin.js';
    }

    if (apps.instance.embed.enabled) {
        entries['instance.embed'] = './entries/coreEntryInstanceEmbed.js';
    }

    if (apps.control.www.enabled) {
        entries['control.www'] = './entries/coreEntryControlWww.js';
    }

    if (apps.owner.enabled) {
        entries['owner.www'] = './entries/coreEntryOwnerWww.js';
    }

    if (apps.owner.admin.enabled) {
        entries['owner.admin'] = './entries/coreEntryOwnerAdmin.js';
    }

    if (apps.owner.embed.enabled) {
        entries['owner.embed'] = './entries/coreEntryOwnerEmbed.js';
    }

    if (Object.keys(entries).length === 0) {
        console.error(`no entries defined, check you have at least 1 app enabled in instanceApps.js`);
    }

    return entries;
}

//the config
module.exports = {
    watch: false,
    watchOptions: {
        poll: true,
        ignored: [
            /(^|[\\/])public($|[\\/])/,
            /(^|[\\/])norepo($|[\\/])/,
            /(^|[\\/])node_modules($|[\\/])/,
            /node_modules/,
            /public[\\/].*js/,
            /public[\\/].*css/,
        ],
    },

    context: path.resolve(__dirname, 'core/private'),//root directory for finding entry points (the core entry points import from the instance entry points)

    entry:  JavascriptEntryPoints(),

    output: {
        path: path.resolve(__dirname, 'public'),
        filename: 'js/[name].bundle.js',
        sourceMapFilename: 'js/[file].map',
        chunkFilename: 'js/[name].chunk.js',
        publicPath: '/',
    },

    resolve: {
        modules: ['node_modules'],
        plugins: [new CoreProtocolPlugin()],
        alias: Object.assign({}, ...[{
            //module fixes!
            moment$: 'moment/moment.js',//fixes: https://github.com/moment/moment/issues/2979
            'TweenMax': 'gsap',
        },

        //filter undefined to allow optional build!
        ].filter(alias =&gt; !!alias)),
    },

    externals: {
        settings: 'settings',//the server request output from core!
    },

    module: {
        rules: [
            //node_module fixes
            {
                test: /node_modules[\\/]typed\.js[\\/].*\.js$/,
                use: [
                    {
                        loader: 'babel-loader',
                        options: {
                            plugins: [require('babel-plugin-transform-object-rest-spread')],
                        },
                    },
                ],
            },

            //pug
            {
                test: /\.pug$/,
                use: [
                    {
                        loader: 'pug-loader',
                        query: {
                            //root: path.resolve(__dirname, './core/private/empty.scss'),
                        },
                    },
                ],
            },

            //css imports
            {
                test: /\.scss|\.css$/,
                use: ExtractTextPlugin.extract({
                    fallback: ['style-loader'],
                    use: [
                        {
                            loader: 'css-loader'
                        },
                        {
                            loader: 'resolve-url-loader'
                        },
                        {
                            loader: 'sass-loader',
                            query: (sassPrecision?'&amp;precision='+sassPrecision:'')+(!buildMaps?'':'&amp;sourceMap'),
                        }
                    ],
                    allChunks: true,
                }),
            },

            //monkey apps
            {
                test: monkeyPattern,
                use: [
                    !buildMonkeyApps?{loader:'ignore-loader'}:{
                        loader: 'exports-loader',
                        query: 'BBMonkeyGame',
                    },
                ],
            },

            //monkey data
            //this imports all monkey apps into public/monkey/[appFolderName]/data/*
            //we then need to setup static express routes to route the data per page e.g.
            //app.use('/admin/app/data', express.static(path.join(__dirname, './public/monkey/appPreview/data')));
            {
                test: monkeyDataPattern,
                use: [
                    !buildMonkeyApps?{loader:'ignore-loader'}:{
                        loader: 'file-loader',
                        query: {
                            regExp: monkeyDataPattern,
                            name: 'monkey/[1]/app/data/[2]/[name].[ext]',
                        },
                    },
                ],
            },

            //fonts (copy to /public/fonts)
            //as we want .svgs to be treated as &quot;images&quot; we need to manually specify any inclusions here
            !buildFonts?undefined:{
                test: /(fontawesome.*\.svg|\.(ttf|otf|eot|woff(2)?))(\?[a-z0-9]+)?$/,
                exclude: [
                    monkeyDataPattern,
                ],
                use: [
                    {
                        loader: 'file-loader',
                        query: {
                            name: 'fonts/[name].[hash].[ext]',
                        },
                    },
                ],
            },

            //images (copy to /public/images)
            !buildImages?undefined:{
                test: /\.(jpe?g|gif|png|svg)$/,
                exclude: [
                    //make sure to exclude any manually defined font .svgs here
                    /fontawesome.*\.svg(\?[a-z0-9]+)?$/,
                ],
                use: [
                    {
                        loader: 'file-loader',
                        query: {
                            emitFile: true,
                            name: 'images/[name].[hash].[ext]',
                        },
                    },
                ],
            },

            //babel conversion
            !buildBabel?undefined:{
                test: /\.js$/,
                exclude: [
                    /(node_modules)/,
                    monkeyPattern,
                ],
                use: [
                    {
                        loader: 'babel-loader',
                    },
                ],
            },

            //expose globals to modules!
            {
                test: require.resolve('jquery'),
                use: [
                    {
                        loader: 'expose-loader',
                        query: 'jQuery',
                    },
                    {
                        loader: 'expose-loader',
                        query: '$',
                    },
                ],

            },
            /*
            {
                test: require.resolve('gsap'),
                use: [
                    {
                        loader: 'expose-loader',
                        query: 'TweenMax',
                    },
                    {
                        loader: 'expose-loader',
                        query: 'TimelineMax',
                    },
                ],
            },
            */

        //filter undefined rules
        ].filter(rule =&gt; !!rule),
    },

    plugins: [
        //custom webpack plugins to fix sheeeet
        new IncludeExcludePlugin(),
        new WatchOffsetPlugin(),

        //allow import of css in js
        new ExtractTextPlugin({
            //convert bundle [name] (js/blah.bundle.js) into css/blah.bundle.css
            filename: getPath =&gt; 'css/'+path.basename(getPath('[name]'), '.js')+'.bundle.css',
            allChunks: false,//allows for imported chunks to add scss to bundle
        }),

        //setup .map file generation
        !buildMaps?undefined:new webpack.SourceMapDevToolPlugin({
            filename: '[file].map',
            exclude: ['vendor.bundle.js', /\.css$/, /\.scss$/],
        }),

        //auto load modules (really we should never be doing this!)
        new webpack.ProvidePlugin({
            //jQuery: 'jquery',
            //$: 'jquery',
            //moment: 'moment',
        }),

        //limit moment locales
        new webpack.ContextReplacementPlugin(/moment[/\\]locale$/, /en/),

        //allow dynamic import using custom @loader syntax.
        //we are allowing the @loader syntax complete access to the root (of the app) file system.
        //we limit what is processed in the private/coreAppBase import comment tags.
        //we limit what files are included via the ContextReplacementPlugin regexp below!

        //help: https://iamakulov.com/notes/webpack-contextreplacementplugin/

        new webpack.IgnorePlugin(/^@loader/, /node_modules/),

        !buildLoaders?new webpack.IgnorePlugin(/^@loader/):new webpack.ContextReplacementPlugin(
            /^@loader/,
            path.resolve(__dirname, './'),
            true,
            /[/\\](core|instance)[/\\](?:(?:components|features[/\\].*[/\\]components)[/\\].*\1Component[a-zA-Z0-9]*[/\\]loader\.js$|(?:private|features[/\\][a-zA-Z0-9-_]*)[/\\](?:[a-zA-Z0-9-_]*[/\\])*loaders[/\\](?:[a-zA-Z0-9-_]*[/\\])*\1Loader[A-Z0-9][a-zA-Z0-9-_]*\.js$)/,
        ),

        //generate vendor
        new webpack.optimize.CommonsChunkPlugin({
            name: 'vendor.bundle',
            filename: 'js/vendor.bundle.js',
        }),

        //force common dependencies (for lazy load) into chunk
        new webpack.optimize.CommonsChunkPlugin({
            name: Object.keys(JavascriptEntryPoints()),
            children: true,
            minChunks: 4,
            async: 'common',
        }),

    //plugins based on environment mode
    ].concat(development?[
        //development
    ]:[
        //production
        new MinifyPlugin({
            mangle: {
                //need these to protect our this.constructor.name code!
                keepClassName: true,
                keepFnName: true,
            },
        }, {}),

    //filter null plugins (allows inline conditional plugins)
    ]).filter(plugin =&gt; !!plugin),
};"><pre class="notranslate"><span class="pl-s">'use strict'</span><span class="pl-kos">;</span>

<span class="pl-c">//module imports</span>
<span class="pl-k">const</span> <span class="pl-s1">webpack</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'webpack'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">path</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'path'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-v">ExtractTextPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'extract-text-webpack-plugin'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-v">MinifyPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"babel-minify-webpack-plugin"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-c">//custom plugin imports</span>
<span class="pl-k">const</span> <span class="pl-v">IncludeExcludePlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'./webpack/plugins/IncludeExcludePlugin.js'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-v">WatchOffsetPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'./webpack/plugins/WatchOffsetPlugin.js'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-v">CoreProtocolPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'./webpack/plugins/CoreProtocolPlugin.js'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-c">//local imports</span>
<span class="pl-k">const</span> <span class="pl-s1">apps</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'./core/coreApps'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-c">//constants</span>
<span class="pl-k">const</span> <span class="pl-s1">development</span> <span class="pl-c1">=</span> <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">NODE_ENV</span> <span class="pl-c1">===</span> <span class="pl-s">'dev'</span> <span class="pl-c1">||</span> <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">NODE_ENV</span> <span class="pl-c1">===</span> <span class="pl-s">'development'</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">sassPrecision</span> <span class="pl-c1">=</span> <span class="pl-c1">10</span><span class="pl-kos">;</span><span class="pl-c">//this is important! precision fix detailed here: https://github.com/twbs/bootstrap-sass/issues/409</span>

<span class="pl-c">//build flags</span>
<span class="pl-k">const</span> <span class="pl-s1">buildMaps</span> <span class="pl-c1">=</span> <span class="pl-c1">false</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">buildMonkeyApps</span> <span class="pl-c1">=</span> <span class="pl-c1">false</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">buildBabel</span> <span class="pl-c1">=</span> <span class="pl-c1">false</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">buildFonts</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">buildImages</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">buildLoaders</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span>

<span class="pl-c">//regexp patterns</span>
<span class="pl-k">const</span> <span class="pl-s1">monkeyPattern</span> <span class="pl-c1">=</span> <span class="pl-pds"><span class="pl-c1">/</span>external<span class="pl-kos">[</span><span class="pl-cce">\\</span><span class="pl-cce">\/</span><span class="pl-kos">]</span>monkey<span class="pl-kos">[</span><span class="pl-cce">\\</span><span class="pl-cce">\/</span><span class="pl-kos">]</span><span class="pl-kos">(</span><span class="pl-kos">[</span>a-z0-9_-<span class="pl-kos">]</span><span class="pl-c1">+</span><span class="pl-kos">)</span><span class="pl-kos">[</span><span class="pl-cce">\\</span><span class="pl-cce">\/</span><span class="pl-kos">]</span>app<span class="pl-kos">[</span><span class="pl-cce">\\</span><span class="pl-cce">\/</span><span class="pl-kos">]</span>main.js<span class="pl-cce">$</span><span class="pl-c1">/</span>i</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">monkeyDataPattern</span> <span class="pl-c1">=</span> <span class="pl-pds"><span class="pl-c1">/</span>external<span class="pl-kos">[</span><span class="pl-cce">\\</span><span class="pl-cce">\/</span><span class="pl-kos">]</span>monkey<span class="pl-kos">[</span><span class="pl-cce">\\</span><span class="pl-cce">\/</span><span class="pl-kos">]</span><span class="pl-kos">(</span><span class="pl-kos">[</span>a-z0-9_-<span class="pl-kos">]</span><span class="pl-c1">+</span><span class="pl-kos">)</span><span class="pl-kos">[</span><span class="pl-cce">\\</span><span class="pl-cce">\/</span><span class="pl-kos">]</span>app<span class="pl-kos">[</span><span class="pl-cce">\\</span><span class="pl-cce">\/</span><span class="pl-kos">]</span>data<span class="pl-kos">(</span><span class="pl-kos">[</span>a-z0-9-_@<span class="pl-cce">\\</span><span class="pl-cce">\/</span><span class="pl-kos">]</span><span class="pl-c1">*</span><span class="pl-kos">)</span><span class="pl-kos">[</span><span class="pl-cce">\\</span><span class="pl-cce">\/</span><span class="pl-kos">]</span><span class="pl-kos">(</span><span class="pl-kos">[</span>a-z0-9-_@<span class="pl-kos">]</span><span class="pl-c1">+</span><span class="pl-cce">\.</span><span class="pl-kos">(?:</span>png<span class="pl-c1">|</span>jpg<span class="pl-c1">|</span>jpeg<span class="pl-c1">|</span>gif<span class="pl-c1">|</span>svg<span class="pl-c1">|</span>txt<span class="pl-c1">|</span>ttf<span class="pl-c1">|</span>json<span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-cce">$</span><span class="pl-c1">/</span>i</span><span class="pl-kos">;</span>

<span class="pl-c">//functions</span>
<span class="pl-k">function</span> <span class="pl-v">JavascriptEntryPoints</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">const</span> <span class="pl-s1">entries</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">;</span>

    <span class="pl-c">//only include entry points enabled in teh config</span>
    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">apps</span><span class="pl-kos">.</span><span class="pl-c1">instance</span><span class="pl-kos">.</span><span class="pl-c1">www</span><span class="pl-kos">.</span><span class="pl-c1">enabled</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-s1">entries</span><span class="pl-kos">[</span><span class="pl-s">'instance.www'</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-s">'./entries/coreEntryInstanceWww.js'</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">apps</span><span class="pl-kos">.</span><span class="pl-c1">instance</span><span class="pl-kos">.</span><span class="pl-c1">admin</span><span class="pl-kos">.</span><span class="pl-c1">enabled</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-s1">entries</span><span class="pl-kos">[</span><span class="pl-s">'instance.admin'</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-s">'./entries/coreEntryInstanceAdmin.js'</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">apps</span><span class="pl-kos">.</span><span class="pl-c1">instance</span><span class="pl-kos">.</span><span class="pl-c1">embed</span><span class="pl-kos">.</span><span class="pl-c1">enabled</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-s1">entries</span><span class="pl-kos">[</span><span class="pl-s">'instance.embed'</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-s">'./entries/coreEntryInstanceEmbed.js'</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">apps</span><span class="pl-kos">.</span><span class="pl-c1">control</span><span class="pl-kos">.</span><span class="pl-c1">www</span><span class="pl-kos">.</span><span class="pl-c1">enabled</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-s1">entries</span><span class="pl-kos">[</span><span class="pl-s">'control.www'</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-s">'./entries/coreEntryControlWww.js'</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">apps</span><span class="pl-kos">.</span><span class="pl-c1">owner</span><span class="pl-kos">.</span><span class="pl-c1">enabled</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-s1">entries</span><span class="pl-kos">[</span><span class="pl-s">'owner.www'</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-s">'./entries/coreEntryOwnerWww.js'</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">apps</span><span class="pl-kos">.</span><span class="pl-c1">owner</span><span class="pl-kos">.</span><span class="pl-c1">admin</span><span class="pl-kos">.</span><span class="pl-c1">enabled</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-s1">entries</span><span class="pl-kos">[</span><span class="pl-s">'owner.admin'</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-s">'./entries/coreEntryOwnerAdmin.js'</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">apps</span><span class="pl-kos">.</span><span class="pl-c1">owner</span><span class="pl-kos">.</span><span class="pl-c1">embed</span><span class="pl-kos">.</span><span class="pl-c1">enabled</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-s1">entries</span><span class="pl-kos">[</span><span class="pl-s">'owner.embed'</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-s">'./entries/coreEntryOwnerEmbed.js'</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">keys</span><span class="pl-kos">(</span><span class="pl-s1">entries</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">length</span> <span class="pl-c1">===</span> <span class="pl-c1">0</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">error</span><span class="pl-kos">(</span><span class="pl-s">`no entries defined, check you have at least 1 app enabled in instanceApps.js`</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-k">return</span> <span class="pl-s1">entries</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-c">//the config</span>
<span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
    <span class="pl-c1">watch</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
    <span class="pl-c1">watchOptions</span>: <span class="pl-kos">{</span>
        <span class="pl-c1">poll</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
        <span class="pl-c1">ignored</span>: <span class="pl-kos">[</span>
            <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-kos">(</span><span class="pl-cce">^</span><span class="pl-c1">|</span><span class="pl-kos">[</span><span class="pl-cce">\\</span>/<span class="pl-kos">]</span><span class="pl-kos">)</span>public<span class="pl-kos">(</span><span class="pl-cce">$</span><span class="pl-c1">|</span><span class="pl-kos">[</span><span class="pl-cce">\\</span>/<span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
            <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-kos">(</span><span class="pl-cce">^</span><span class="pl-c1">|</span><span class="pl-kos">[</span><span class="pl-cce">\\</span>/<span class="pl-kos">]</span><span class="pl-kos">)</span>norepo<span class="pl-kos">(</span><span class="pl-cce">$</span><span class="pl-c1">|</span><span class="pl-kos">[</span><span class="pl-cce">\\</span>/<span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
            <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-kos">(</span><span class="pl-cce">^</span><span class="pl-c1">|</span><span class="pl-kos">[</span><span class="pl-cce">\\</span>/<span class="pl-kos">]</span><span class="pl-kos">)</span>node_modules<span class="pl-kos">(</span><span class="pl-cce">$</span><span class="pl-c1">|</span><span class="pl-kos">[</span><span class="pl-cce">\\</span>/<span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
            <span class="pl-pds"><span class="pl-c1">/</span>node_modules<span class="pl-c1">/</span></span><span class="pl-kos">,</span>
            <span class="pl-pds"><span class="pl-c1">/</span>public<span class="pl-kos">[</span><span class="pl-cce">\\</span>/<span class="pl-kos">]</span>.<span class="pl-c1">*</span>js<span class="pl-c1">/</span></span><span class="pl-kos">,</span>
            <span class="pl-pds"><span class="pl-c1">/</span>public<span class="pl-kos">[</span><span class="pl-cce">\\</span>/<span class="pl-kos">]</span>.<span class="pl-c1">*</span>css<span class="pl-c1">/</span></span><span class="pl-kos">,</span>
        <span class="pl-kos">]</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>

    <span class="pl-c1">context</span>: <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s1">__dirname</span><span class="pl-kos">,</span> <span class="pl-s">'core/private'</span><span class="pl-kos">)</span><span class="pl-kos">,</span><span class="pl-c">//root directory for finding entry points (the core entry points import from the instance entry points)</span>

    <span class="pl-c1">entry</span>:  <span class="pl-v">JavascriptEntryPoints</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span>

    <span class="pl-c1">output</span>: <span class="pl-kos">{</span>
        <span class="pl-c1">path</span>: <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s1">__dirname</span><span class="pl-kos">,</span> <span class="pl-s">'public'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
        <span class="pl-c1">filename</span>: <span class="pl-s">'js/[name].bundle.js'</span><span class="pl-kos">,</span>
        <span class="pl-c1">sourceMapFilename</span>: <span class="pl-s">'js/[file].map'</span><span class="pl-kos">,</span>
        <span class="pl-c1">chunkFilename</span>: <span class="pl-s">'js/[name].chunk.js'</span><span class="pl-kos">,</span>
        <span class="pl-c1">publicPath</span>: <span class="pl-s">'/'</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>

    <span class="pl-c1">resolve</span>: <span class="pl-kos">{</span>
        <span class="pl-c1">modules</span>: <span class="pl-kos">[</span><span class="pl-s">'node_modules'</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-c1">plugins</span>: <span class="pl-kos">[</span><span class="pl-k">new</span> <span class="pl-v">CoreProtocolPlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-c1">alias</span>: <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">assign</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> ...<span class="pl-kos">[</span><span class="pl-kos">{</span>
            <span class="pl-c">//module fixes!</span>
            <span class="pl-c1">moment$</span>: <span class="pl-s">'moment/moment.js'</span><span class="pl-kos">,</span><span class="pl-c">//fixes: https://github.com/moment/moment/issues/2979</span>
            <span class="pl-s">'TweenMax'</span>: <span class="pl-s">'gsap'</span><span class="pl-kos">,</span>
        <span class="pl-kos">}</span><span class="pl-kos">,</span>

        <span class="pl-c">//filter undefined to allow optional build!</span>
        <span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en">filter</span><span class="pl-kos">(</span><span class="pl-s1">alias</span> <span class="pl-c1">=&gt;</span> <span class="pl-c1">!</span><span class="pl-c1">!</span><span class="pl-s1">alias</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>

    <span class="pl-c1">externals</span>: <span class="pl-kos">{</span>
        <span class="pl-c1">settings</span>: <span class="pl-s">'settings'</span><span class="pl-kos">,</span><span class="pl-c">//the server request output from core!</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>

    <span class="pl-c1">module</span>: <span class="pl-kos">{</span>
        <span class="pl-c1">rules</span>: <span class="pl-kos">[</span>
            <span class="pl-c">//node_module fixes</span>
            <span class="pl-kos">{</span>
                <span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span>node_modules<span class="pl-kos">[</span><span class="pl-cce">\\</span>/<span class="pl-kos">]</span>typed<span class="pl-cce">\.</span>js<span class="pl-kos">[</span><span class="pl-cce">\\</span>/<span class="pl-kos">]</span>.<span class="pl-c1">*</span><span class="pl-cce">\.</span>js<span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
                <span class="pl-c1">use</span>: <span class="pl-kos">[</span>
                    <span class="pl-kos">{</span>
                        <span class="pl-c1">loader</span>: <span class="pl-s">'babel-loader'</span><span class="pl-kos">,</span>
                        <span class="pl-c1">options</span>: <span class="pl-kos">{</span>
                            <span class="pl-c1">plugins</span>: <span class="pl-kos">[</span><span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'babel-plugin-transform-object-rest-spread'</span><span class="pl-kos">)</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
                        <span class="pl-kos">}</span><span class="pl-kos">,</span>
                    <span class="pl-kos">}</span><span class="pl-kos">,</span>
                <span class="pl-kos">]</span><span class="pl-kos">,</span>
            <span class="pl-kos">}</span><span class="pl-kos">,</span>

            <span class="pl-c">//pug</span>
            <span class="pl-kos">{</span>
                <span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span>pug<span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
                <span class="pl-c1">use</span>: <span class="pl-kos">[</span>
                    <span class="pl-kos">{</span>
                        <span class="pl-c1">loader</span>: <span class="pl-s">'pug-loader'</span><span class="pl-kos">,</span>
                        <span class="pl-c1">query</span>: <span class="pl-kos">{</span>
                            <span class="pl-c">//root: path.resolve(__dirname, './core/private/empty.scss'),</span>
                        <span class="pl-kos">}</span><span class="pl-kos">,</span>
                    <span class="pl-kos">}</span><span class="pl-kos">,</span>
                <span class="pl-kos">]</span><span class="pl-kos">,</span>
            <span class="pl-kos">}</span><span class="pl-kos">,</span>

            <span class="pl-c">//css imports</span>
            <span class="pl-kos">{</span>
                <span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span>scss<span class="pl-c1">|</span><span class="pl-cce">\.</span>css<span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
                <span class="pl-c1">use</span>: <span class="pl-v">ExtractTextPlugin</span><span class="pl-kos">.</span><span class="pl-en">extract</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
                    <span class="pl-c1">fallback</span>: <span class="pl-kos">[</span><span class="pl-s">'style-loader'</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
                    <span class="pl-c1">use</span>: <span class="pl-kos">[</span>
                        <span class="pl-kos">{</span>
                            <span class="pl-c1">loader</span>: <span class="pl-s">'css-loader'</span>
                        <span class="pl-kos">}</span><span class="pl-kos">,</span>
                        <span class="pl-kos">{</span>
                            <span class="pl-c1">loader</span>: <span class="pl-s">'resolve-url-loader'</span>
                        <span class="pl-kos">}</span><span class="pl-kos">,</span>
                        <span class="pl-kos">{</span>
                            <span class="pl-c1">loader</span>: <span class="pl-s">'sass-loader'</span><span class="pl-kos">,</span>
                            <span class="pl-c1">query</span>: <span class="pl-kos">(</span><span class="pl-s1">sassPrecision</span>?<span class="pl-s">'&amp;precision='</span><span class="pl-c1">+</span><span class="pl-s1">sassPrecision</span>:<span class="pl-s">''</span><span class="pl-kos">)</span><span class="pl-c1">+</span><span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-s1">buildMaps</span>?<span class="pl-s">''</span>:<span class="pl-s">'&amp;sourceMap'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
                        <span class="pl-kos">}</span>
                    <span class="pl-kos">]</span><span class="pl-kos">,</span>
                    <span class="pl-c1">allChunks</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
                <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
            <span class="pl-kos">}</span><span class="pl-kos">,</span>

            <span class="pl-c">//monkey apps</span>
            <span class="pl-kos">{</span>
                <span class="pl-c1">test</span>: <span class="pl-s1">monkeyPattern</span><span class="pl-kos">,</span>
                <span class="pl-c1">use</span>: <span class="pl-kos">[</span>
                    <span class="pl-c1">!</span><span class="pl-s1">buildMonkeyApps</span>?<span class="pl-kos">{</span><span class="pl-c1">loader</span>:<span class="pl-s">'ignore-loader'</span><span class="pl-kos">}</span>:<span class="pl-kos">{</span>
                        <span class="pl-c1">loader</span>: <span class="pl-s">'exports-loader'</span><span class="pl-kos">,</span>
                        <span class="pl-c1">query</span>: <span class="pl-s">'BBMonkeyGame'</span><span class="pl-kos">,</span>
                    <span class="pl-kos">}</span><span class="pl-kos">,</span>
                <span class="pl-kos">]</span><span class="pl-kos">,</span>
            <span class="pl-kos">}</span><span class="pl-kos">,</span>

            <span class="pl-c">//monkey data</span>
            <span class="pl-c">//this imports all monkey apps into public/monkey/[appFolderName]/data/*</span>
            <span class="pl-c">//we then need to setup static express routes to route the data per page e.g.</span>
            <span class="pl-c">//app.use('/admin/app/data', express.static(path.join(__dirname, './public/monkey/appPreview/data')));</span>
            <span class="pl-kos">{</span>
                <span class="pl-c1">test</span>: <span class="pl-s1">monkeyDataPattern</span><span class="pl-kos">,</span>
                <span class="pl-c1">use</span>: <span class="pl-kos">[</span>
                    <span class="pl-c1">!</span><span class="pl-s1">buildMonkeyApps</span>?<span class="pl-kos">{</span><span class="pl-c1">loader</span>:<span class="pl-s">'ignore-loader'</span><span class="pl-kos">}</span>:<span class="pl-kos">{</span>
                        <span class="pl-c1">loader</span>: <span class="pl-s">'file-loader'</span><span class="pl-kos">,</span>
                        <span class="pl-c1">query</span>: <span class="pl-kos">{</span>
                            <span class="pl-c1">regExp</span>: <span class="pl-s1">monkeyDataPattern</span><span class="pl-kos">,</span>
                            <span class="pl-c1">name</span>: <span class="pl-s">'monkey/[1]/app/data/[2]/[name].[ext]'</span><span class="pl-kos">,</span>
                        <span class="pl-kos">}</span><span class="pl-kos">,</span>
                    <span class="pl-kos">}</span><span class="pl-kos">,</span>
                <span class="pl-kos">]</span><span class="pl-kos">,</span>
            <span class="pl-kos">}</span><span class="pl-kos">,</span>

            <span class="pl-c">//fonts (copy to /public/fonts)</span>
            <span class="pl-c">//as we want .svgs to be treated as "images" we need to manually specify any inclusions here</span>
            <span class="pl-c1">!</span><span class="pl-s1">buildFonts</span>?<span class="pl-c1">undefined</span>:<span class="pl-kos">{</span>
                <span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-kos">(</span>fontawesome.<span class="pl-c1">*</span><span class="pl-cce">\.</span>svg<span class="pl-c1">|</span><span class="pl-cce">\.</span><span class="pl-kos">(</span>ttf<span class="pl-c1">|</span>otf<span class="pl-c1">|</span>eot<span class="pl-c1">|</span>woff<span class="pl-kos">(</span>2<span class="pl-kos">)</span>?<span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-cce">\?</span><span class="pl-kos">[</span>a-z0-9<span class="pl-kos">]</span><span class="pl-c1">+</span><span class="pl-kos">)</span>?<span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
                <span class="pl-c1">exclude</span>: <span class="pl-kos">[</span>
                    <span class="pl-s1">monkeyDataPattern</span><span class="pl-kos">,</span>
                <span class="pl-kos">]</span><span class="pl-kos">,</span>
                <span class="pl-c1">use</span>: <span class="pl-kos">[</span>
                    <span class="pl-kos">{</span>
                        <span class="pl-c1">loader</span>: <span class="pl-s">'file-loader'</span><span class="pl-kos">,</span>
                        <span class="pl-c1">query</span>: <span class="pl-kos">{</span>
                            <span class="pl-c1">name</span>: <span class="pl-s">'fonts/[name].[hash].[ext]'</span><span class="pl-kos">,</span>
                        <span class="pl-kos">}</span><span class="pl-kos">,</span>
                    <span class="pl-kos">}</span><span class="pl-kos">,</span>
                <span class="pl-kos">]</span><span class="pl-kos">,</span>
            <span class="pl-kos">}</span><span class="pl-kos">,</span>

            <span class="pl-c">//images (copy to /public/images)</span>
            <span class="pl-c1">!</span><span class="pl-s1">buildImages</span>?<span class="pl-c1">undefined</span>:<span class="pl-kos">{</span>
                <span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span><span class="pl-kos">(</span>jpe?g<span class="pl-c1">|</span>gif<span class="pl-c1">|</span>png<span class="pl-c1">|</span>svg<span class="pl-kos">)</span><span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
                <span class="pl-c1">exclude</span>: <span class="pl-kos">[</span>
                    <span class="pl-c">//make sure to exclude any manually defined font .svgs here</span>
                    <span class="pl-pds"><span class="pl-c1">/</span>fontawesome.<span class="pl-c1">*</span><span class="pl-cce">\.</span>svg<span class="pl-kos">(</span><span class="pl-cce">\?</span><span class="pl-kos">[</span>a-z0-9<span class="pl-kos">]</span><span class="pl-c1">+</span><span class="pl-kos">)</span>?<span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
                <span class="pl-kos">]</span><span class="pl-kos">,</span>
                <span class="pl-c1">use</span>: <span class="pl-kos">[</span>
                    <span class="pl-kos">{</span>
                        <span class="pl-c1">loader</span>: <span class="pl-s">'file-loader'</span><span class="pl-kos">,</span>
                        <span class="pl-c1">query</span>: <span class="pl-kos">{</span>
                            <span class="pl-c1">emitFile</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
                            <span class="pl-c1">name</span>: <span class="pl-s">'images/[name].[hash].[ext]'</span><span class="pl-kos">,</span>
                        <span class="pl-kos">}</span><span class="pl-kos">,</span>
                    <span class="pl-kos">}</span><span class="pl-kos">,</span>
                <span class="pl-kos">]</span><span class="pl-kos">,</span>
            <span class="pl-kos">}</span><span class="pl-kos">,</span>

            <span class="pl-c">//babel conversion</span>
            <span class="pl-c1">!</span><span class="pl-s1">buildBabel</span>?<span class="pl-c1">undefined</span>:<span class="pl-kos">{</span>
                <span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span>js<span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
                <span class="pl-c1">exclude</span>: <span class="pl-kos">[</span>
                    <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-kos">(</span>node_modules<span class="pl-kos">)</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
                    <span class="pl-s1">monkeyPattern</span><span class="pl-kos">,</span>
                <span class="pl-kos">]</span><span class="pl-kos">,</span>
                <span class="pl-c1">use</span>: <span class="pl-kos">[</span>
                    <span class="pl-kos">{</span>
                        <span class="pl-c1">loader</span>: <span class="pl-s">'babel-loader'</span><span class="pl-kos">,</span>
                    <span class="pl-kos">}</span><span class="pl-kos">,</span>
                <span class="pl-kos">]</span><span class="pl-kos">,</span>
            <span class="pl-kos">}</span><span class="pl-kos">,</span>

            <span class="pl-c">//expose globals to modules!</span>
            <span class="pl-kos">{</span>
                <span class="pl-c1">test</span>: <span class="pl-en">require</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s">'jquery'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
                <span class="pl-c1">use</span>: <span class="pl-kos">[</span>
                    <span class="pl-kos">{</span>
                        <span class="pl-c1">loader</span>: <span class="pl-s">'expose-loader'</span><span class="pl-kos">,</span>
                        <span class="pl-c1">query</span>: <span class="pl-s">'jQuery'</span><span class="pl-kos">,</span>
                    <span class="pl-kos">}</span><span class="pl-kos">,</span>
                    <span class="pl-kos">{</span>
                        <span class="pl-c1">loader</span>: <span class="pl-s">'expose-loader'</span><span class="pl-kos">,</span>
                        <span class="pl-c1">query</span>: <span class="pl-s">'$'</span><span class="pl-kos">,</span>
                    <span class="pl-kos">}</span><span class="pl-kos">,</span>
                <span class="pl-kos">]</span><span class="pl-kos">,</span>

            <span class="pl-kos">}</span><span class="pl-kos">,</span>
            <span class="pl-c">/*</span>
<span class="pl-c">            {</span>
<span class="pl-c">                test: require.resolve('gsap'),</span>
<span class="pl-c">                use: [</span>
<span class="pl-c">                    {</span>
<span class="pl-c">                        loader: 'expose-loader',</span>
<span class="pl-c">                        query: 'TweenMax',</span>
<span class="pl-c">                    },</span>
<span class="pl-c">                    {</span>
<span class="pl-c">                        loader: 'expose-loader',</span>
<span class="pl-c">                        query: 'TimelineMax',</span>
<span class="pl-c">                    },</span>
<span class="pl-c">                ],</span>
<span class="pl-c">            },</span>
<span class="pl-c">            */</span>

        <span class="pl-c">//filter undefined rules</span>
        <span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en">filter</span><span class="pl-kos">(</span><span class="pl-s1">rule</span> <span class="pl-c1">=&gt;</span> <span class="pl-c1">!</span><span class="pl-c1">!</span><span class="pl-s1">rule</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>

    <span class="pl-c1">plugins</span>: <span class="pl-kos">[</span>
        <span class="pl-c">//custom webpack plugins to fix sheeeet</span>
        <span class="pl-k">new</span> <span class="pl-v">IncludeExcludePlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
        <span class="pl-k">new</span> <span class="pl-v">WatchOffsetPlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span>

        <span class="pl-c">//allow import of css in js</span>
        <span class="pl-k">new</span> <span class="pl-v">ExtractTextPlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
            <span class="pl-c">//convert bundle [name] (js/blah.bundle.js) into css/blah.bundle.css</span>
            <span class="pl-en">filename</span>: <span class="pl-s1">getPath</span> <span class="pl-c1">=&gt;</span> <span class="pl-s">'css/'</span><span class="pl-c1">+</span><span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">basename</span><span class="pl-kos">(</span><span class="pl-en">getPath</span><span class="pl-kos">(</span><span class="pl-s">'[name]'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s">'.js'</span><span class="pl-kos">)</span><span class="pl-c1">+</span><span class="pl-s">'.bundle.css'</span><span class="pl-kos">,</span>
            <span class="pl-c1">allChunks</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span><span class="pl-c">//allows for imported chunks to add scss to bundle</span>
        <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span>

        <span class="pl-c">//setup .map file generation</span>
        <span class="pl-c1">!</span><span class="pl-s1">buildMaps</span>?<span class="pl-c1">undefined</span>:<span class="pl-k">new</span> <span class="pl-s1">webpack</span><span class="pl-kos">.</span><span class="pl-c1">SourceMapDevToolPlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
            <span class="pl-c1">filename</span>: <span class="pl-s">'[file].map'</span><span class="pl-kos">,</span>
            <span class="pl-c1">exclude</span>: <span class="pl-kos">[</span><span class="pl-s">'vendor.bundle.js'</span><span class="pl-kos">,</span> <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span>css<span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span> <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span>scss<span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span>

        <span class="pl-c">//auto load modules (really we should never be doing this!)</span>
        <span class="pl-k">new</span> <span class="pl-s1">webpack</span><span class="pl-kos">.</span><span class="pl-c1">ProvidePlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
            <span class="pl-c">//jQuery: 'jquery',</span>
            <span class="pl-c">//$: 'jquery',</span>
            <span class="pl-c">//moment: 'moment',</span>
        <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span>

        <span class="pl-c">//limit moment locales</span>
        <span class="pl-k">new</span> <span class="pl-s1">webpack</span><span class="pl-kos">.</span><span class="pl-c1">ContextReplacementPlugin</span><span class="pl-kos">(</span><span class="pl-pds"><span class="pl-c1">/</span>moment<span class="pl-kos">[</span>/<span class="pl-cce">\\</span><span class="pl-kos">]</span>locale<span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span> <span class="pl-pds"><span class="pl-c1">/</span>en<span class="pl-c1">/</span></span><span class="pl-kos">)</span><span class="pl-kos">,</span>

        <span class="pl-c">//allow dynamic import using custom <span class="pl-k">@loader</span> syntax.</span>
        <span class="pl-c">//we are allowing the <span class="pl-k">@loader</span> syntax complete access to the root (of the app) file system.</span>
        <span class="pl-c">//we limit what is processed in the private/coreAppBase import comment tags.</span>
        <span class="pl-c">//we limit what files are included via the ContextReplacementPlugin regexp below!</span>

        <span class="pl-c">//help: https://iamakulov.com/notes/webpack-contextreplacementplugin/</span>

        <span class="pl-k">new</span> <span class="pl-s1">webpack</span><span class="pl-kos">.</span><span class="pl-c1">IgnorePlugin</span><span class="pl-kos">(</span><span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">^</span>@loader<span class="pl-c1">/</span></span><span class="pl-kos">,</span> <span class="pl-pds"><span class="pl-c1">/</span>node_modules<span class="pl-c1">/</span></span><span class="pl-kos">)</span><span class="pl-kos">,</span>

        <span class="pl-c1">!</span><span class="pl-s1">buildLoaders</span>?<span class="pl-k">new</span> <span class="pl-s1">webpack</span><span class="pl-kos">.</span><span class="pl-c1">IgnorePlugin</span><span class="pl-kos">(</span><span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">^</span>@loader<span class="pl-c1">/</span></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">ContextReplacementPlugin</span><span class="pl-kos">(</span>
            <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">^</span>@loader<span class="pl-c1">/</span></span><span class="pl-kos">,</span>
            <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s1">__dirname</span><span class="pl-kos">,</span> <span class="pl-s">'./'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
            <span class="pl-c1">true</span><span class="pl-kos">,</span>
            <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-kos">[</span>/<span class="pl-cce">\\</span><span class="pl-kos">]</span><span class="pl-kos">(</span>core<span class="pl-c1">|</span>instance<span class="pl-kos">)</span><span class="pl-kos">[</span>/<span class="pl-cce">\\</span><span class="pl-kos">]</span><span class="pl-kos">(?:</span><span class="pl-kos">(?:</span>components<span class="pl-c1">|</span>features<span class="pl-kos">[</span>/<span class="pl-cce">\\</span><span class="pl-kos">]</span>.<span class="pl-c1">*</span><span class="pl-kos">[</span>/<span class="pl-cce">\\</span><span class="pl-kos">]</span>components<span class="pl-kos">)</span><span class="pl-kos">[</span>/<span class="pl-cce">\\</span><span class="pl-kos">]</span>.<span class="pl-c1">*</span>\1Component<span class="pl-kos">[</span>a-zA-Z0-9<span class="pl-kos">]</span><span class="pl-c1">*</span><span class="pl-kos">[</span>/<span class="pl-cce">\\</span><span class="pl-kos">]</span>loader<span class="pl-cce">\.</span>js<span class="pl-cce">$</span><span class="pl-c1">|</span><span class="pl-kos">(?:</span>private<span class="pl-c1">|</span>features<span class="pl-kos">[</span>/<span class="pl-cce">\\</span><span class="pl-kos">]</span><span class="pl-kos">[</span>a-zA-Z0-9-_<span class="pl-kos">]</span><span class="pl-c1">*</span><span class="pl-kos">)</span><span class="pl-kos">[</span>/<span class="pl-cce">\\</span><span class="pl-kos">]</span><span class="pl-kos">(?:</span><span class="pl-kos">[</span>a-zA-Z0-9-_<span class="pl-kos">]</span><span class="pl-c1">*</span><span class="pl-kos">[</span>/<span class="pl-cce">\\</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-c1">*</span>loaders<span class="pl-kos">[</span>/<span class="pl-cce">\\</span><span class="pl-kos">]</span><span class="pl-kos">(?:</span><span class="pl-kos">[</span>a-zA-Z0-9-_<span class="pl-kos">]</span><span class="pl-c1">*</span><span class="pl-kos">[</span>/<span class="pl-cce">\\</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-c1">*</span>\1Loader<span class="pl-kos">[</span>A-Z0-9<span class="pl-kos">]</span><span class="pl-kos">[</span>a-zA-Z0-9-_<span class="pl-kos">]</span><span class="pl-c1">*</span><span class="pl-cce">\.</span>js<span class="pl-cce">$</span><span class="pl-kos">)</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
        <span class="pl-kos">)</span><span class="pl-kos">,</span>

        <span class="pl-c">//generate vendor</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-s">'vendor.bundle'</span><span class="pl-kos">,</span>
            <span class="pl-c1">filename</span>: <span class="pl-s">'js/vendor.bundle.js'</span><span class="pl-kos">,</span>
        <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span>

        <span class="pl-c">//force common dependencies (for lazy load) into chunk</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-v">Object</span><span class="pl-kos">.</span><span class="pl-en">keys</span><span class="pl-kos">(</span><span class="pl-v">JavascriptEntryPoints</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
            <span class="pl-c1">children</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
            <span class="pl-c1">minChunks</span>: <span class="pl-c1">4</span><span class="pl-kos">,</span>
            <span class="pl-c1">async</span>: <span class="pl-s">'common'</span><span class="pl-kos">,</span>
        <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span>

    <span class="pl-c">//plugins based on environment mode</span>
    <span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en">concat</span><span class="pl-kos">(</span><span class="pl-s1">development</span>?<span class="pl-kos">[</span>
        <span class="pl-c">//development</span>
    <span class="pl-kos">]</span>:<span class="pl-kos">[</span>
        <span class="pl-c">//production</span>
        <span class="pl-k">new</span> <span class="pl-v">MinifyPlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
            <span class="pl-c1">mangle</span>: <span class="pl-kos">{</span>
                <span class="pl-c">//need these to protect our this.constructor.name code!</span>
                <span class="pl-c1">keepClassName</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
                <span class="pl-c1">keepFnName</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
            <span class="pl-kos">}</span><span class="pl-kos">,</span>
        <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span>

    <span class="pl-c">//filter null plugins (allows inline conditional plugins)</span>
    <span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">filter</span><span class="pl-kos">(</span><span class="pl-s1">plugin</span> <span class="pl-c1">=&gt;</span> <span class="pl-c1">!</span><span class="pl-c1">!</span><span class="pl-s1">plugin</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>