<h1 dir="auto">Bug report</h1>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">I'm first trying to figure out which piece of software this behavior most relates to.  Here's the ts-loader issue perspective:  <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="799544653" data-permission-text="Title is private" data-url="https://github.com/TypeStrong/ts-loader/issues/1245" data-hovercard-type="issue" data-hovercard-url="/TypeStrong/ts-loader/issues/1245/hovercard" href="https://github.com/TypeStrong/ts-loader/issues/1245">TypeStrong/ts-loader#1245</a></p>
<p dir="auto">This is for webpack 4.  There are compatibility issues I have yet to work through to get as far in Webpack 5.</p>
<p dir="auto">With Process Monitor on Windows, I'm comparing <code class="notranslate">tsc --build</code> to webpack &amp; ts-loader with and without typechecking.  tsc (with typechecking) is a very clear winner.  ts-loader without typechecking or sourcemaps is about 3x duration.  ts-loader WITH typechecking (<code class="notranslate">transpileOnly: false</code>) is extremely slow.</p>
<p dir="auto">The reason that I'm asking about webpack specifically is that file accesses to .less, .css, .js, and package.json files, for example, are also read hundreds of times and I don't know if that's expected and unavoidable, or if it perhaps represents a bug in webpack 4.<br>
Is webpack responsible for reading package.json files normally?  Or is that 100% a loader problem, such as ... Is the ts-loader repeat reads of some files causing the repeat reads by the loaders of imported non-ts files?</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/17498172/106665699-a1cb5080-6574-11eb-980d-629f6d80328f.png"><img src="https://user-images.githubusercontent.com/17498172/106665699-a1cb5080-6574-11eb-980d-629f6d80328f.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Example sequential repeated reads:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/17498172/106665764-b871a780-6574-11eb-8c75-97d1a878a482.png"><img src="https://user-images.githubusercontent.com/17498172/106665764-b871a780-6574-11eb-8c75-97d1a878a482.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<p dir="auto">Use Sysinternals Process Monitor on Windows to compare ReadFile events between <code class="notranslate">tsc</code> and <code class="notranslate">webpack</code> builds of the same code with similar configurations.</p>
<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">Totals and durations should be similar.</p>
<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version:  4.46.0<br>
Node.js version: 14<br>
Operating System: Windows 10<br>
Additional tools: typescript, ts-loader, <a href="https://docs.microsoft.com/en-us/sysinternals/downloads/procmon" rel="nofollow">Process Monitor</a></p>
<p dir="auto">Firefox gave me these deprecated warnings and I think that they are coming from source map related code.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="SyntaxError: Using //@ to indicate sourceURL pragmas is deprecated. Use //# instead
Use of getPreventDefault() is deprecated.  Use defaultPrevented instead."><pre class="notranslate"><code class="notranslate">SyntaxError: Using //@ to indicate sourceURL pragmas is deprecated. Use //# instead
Use of getPreventDefault() is deprecated.  Use defaultPrevented instead.
</code></pre></div>
<p dir="auto">Should it be changed?</p>