v10.0.0-beta.0Pre-release
Added 1
- Support for the TypeScript 7.1 API
Changed 9
- ts-loader now compiles exclusively through TypeScript's native typescript/sync API, replacing the classic LanguageService, Program, and watch API integration
- Minimum supported TypeScript version is now 7.1 (the 7.1 beta or later until a stable release), up from 3.6.3
- Minimum supported Node.js version is now 22.x, up from 12.x
- The compiler option must now resolve to a package exposing a <compiler>/sync entry point; drop-in classic-API compilers such as ttypescript are no longer supported
- Info-level log messages are now written to stderr by default; set logInfoToStdOut to true to keep them on stdout
- The errorFormatter colors argument is now a picocolors-backed helper object instead of a chalk instance, and chalk has been dropped as a runtime dependency
- The getCustomTransformers option is still accepted but is now inert
- The resolveModuleName and resolveTypeReferenceDirective options are still accepted but are now inert
- Project references in tsconfig.json are followed by the native API, but the projectReferences loader option is accepted and has no effect
Removed 6
- The compilerOptions loader option has been removed; set compiler options in tsconfig.json instead
- The context loader option has been removed; relative paths always resolve against the config file's directory
- The happyPackMode loader option has been removed
- The experimentalFileCaching loader option has been removed
- The experimentalWatchApi loader option has been removed
- The onlyCompileBundledFiles loader option has been removed
From ts-loader
- Support TypeScript 7.1 API - thanks @johnnyreilly
This is a ground-up rewrite of ts-loader's compilation engine. Instead of driving TypeScript's classic LanguageService / Program / watch APIs, ts-loader now compiles exclusively through TypeScript's new native typescript/sync API (https://devblogs.microsoft.com/typescript/announcing-typescript-7-1-beta/#typescript-7.1-api) - the legacy compiler API integration has been removed entirely.
Breaking changes:
- Minimum supported TypeScript version is now 7.1+ (up from 3.6.3+). Until TypeScript 7.1 has a stable release, that means the 7.1 beta or later.
- Minimum supported Node.js version is now 22.x+ (up from 12.x+).
- The
compileroption must now resolve to a package exposing a<compiler>/syncentry point (the TypeScript native API). Drop-in classic-API compilers (e.g.ttypescript) are no longer supported. - Removed the
compilerOptionsloader option; the native API resolves a project's compiler options purely from its on-disk tsconfig.json, with no per-loader-instance override hook. Set compiler options intsconfig.jsoninstead. - Removed the
contextloader option; the native API always resolves relative paths against the config file's own directory, with no basePath override exposed to let a tsconfig live outside the project root. - Removed the
happyPackModeloader option - HappyPack / thread-loader based parallelisation is no longer supported this way. - Removed the
experimentalFileCachingloader option; there's no equivalent under the native API's own caching model. - Removed the
experimentalWatchApiloader option, now that the native API supersedes TypeScript's classic watch API. - Removed the
onlyCompileBundledFilesloader option; the native API always resolves a project's own root files and offers no hook to restrict them to what webpack actually bundles. - Info-level log messages are now written to stderr by default, as documented; previously they always went to stdout regardless of
logInfoToStdOut. SetlogInfoToStdOut: trueto keep them on stdout. errorFormatter'scolorsargument is now a smallpicocolors-backed helper object instead of achalkinstance;chalkhas been dropped as a runtime dependency in favour ofpicocolors.
Not supported yet
getCustomTransformersis still accepted for backwards compatibility but are now inert. The native API doesn't expose equivalent extension points for custom transformes. It is possible that the API will support these in future, and so the options have been left in place for now, but they will be removed if the API never exposes them.resolveModuleNameandresolveTypeReferenceDirectiveare still accepted for backwards compatibility but are now inert. Support for custom resolvers is available: https://github.com/microsoft/TypeScript/pull/64299 - however it is not clear this is a feature generally used by ts-loader users and so has not been implemented at present.- Project references in
tsconfig.jsonare followed by the native API. TheprojectReferencesloader option is accepted but has no effect, and v10 doesn't build referenced projects to disk the waytsc --builddoes.