# Make `lib` Replacement Opt-In by Default https://github.com/microsoft/TypeScript/pull/60829 * Since TypeScript 4.5, we've supported loading `lib` files from `node_modules` if something is located in `@typescript/lib-*`. * But this lib replacement is on for everyone by default, and that leads to us * doing a whole bunch of module resolution all the time at project load going up the spine * add file watchers for each of the directories that *don't* exist. * This is a perf hit for everyone (and it's noisy to look at when diagnosing issues) so we want to make it opt-in. * According to a rudimentary search, 352 files across all of GitHub use a custom `dom`. Limited impact? * 2 major groups who originally asked for this? * People who need to lock on an older `dom` file like `@types/web`. * People who want a custom version of the built-in lib. * How do we roll this out? * Introduce this in 5.8, and then make it the default in 6.0.
Make
libReplacement Opt-In by Default#60829
libfiles fromnode_modulesif something is located in@typescript/lib-*.dom. Limited impact?domfile like@types/web.