From 1d5bcc99e6f433af1b43c0432aea0d65273534a4 Mon Sep 17 00:00:00 2001 From: Brent Erickson Date: Tue, 29 Dec 2020 12:00:37 -0800 Subject: [PATCH] Add documentation for the useCaseSensitiveFileNames option Setting this option on projects with lots of files can reduce compilation time. Case-insensitivty requires normalization of file paths, which involves executing regex's. This shows up in the hot path of compilation profiling. --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index e668de826..7744a6b1b 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ + [appendTsSuffixTo](#appendtssuffixto) + [appendTsxSuffixTo](#appendtsxsuffixto) + [onlyCompileBundledFiles](#onlycompilebundledfiles) + + [useCaseSensitiveFileNames](#useCaseSensitiveFileNames) + [allowTsInNodeModules](#allowtsinnodemodules) + [context](#context) + [experimentalFileCaching](#experimentalfilecaching) @@ -625,6 +626,15 @@ loading only those files that are actually bundled by webpack, as well as any `. by the `tsconfig.json` settings. `.d.ts` files are still included because they may be needed for compilation without being explicitly imported, and therefore not picked up by webpack. +#### useCaseSensitiveFileNames +| Type | Default Value | +|------|--------------| +| `boolean` | determined by typescript based on platform | + +The default behavior of `ts-loader` is to act as a drop-in replacement for the `tsc` command, +so it respects the `useCaseSensitiveFileNames` set internally by typescript. The `useCaseSensitiveFileNames` option modifies this behavior, +by changing the way in which ts-loader resolves file paths to compile. Setting this to true can have some performance benefits due to simplifying the file resolution codepath. + #### allowTsInNodeModules | Type | Default Value | |------|--------------|