Adopt module 'Preserve' for TS 5.4+ (#206478)

This commit is contained in:
Matt Bierner 2024-03-07 13:35:56 -08:00 committed by GitHub
parent bc83cb0632
commit c087be9705
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,8 +26,8 @@ export function inferredProjectCompilerOptions(
serviceConfig: TypeScriptServiceConfiguration,
): Proto.ExternalProjectCompilerOptions {
const projectConfig: Proto.ExternalProjectCompilerOptions = {
module: 'ESNext' as Proto.ModuleKind,
moduleResolution: 'Node' as Proto.ModuleResolutionKind,
module: (version.gte(API.v540) ? 'Preserve' : 'ESNext') as Proto.ModuleKind,
moduleResolution: (version.gte(API.v540) ? 'Bundler' : 'Node') as Proto.ModuleResolutionKind,
target: 'ES2022' as Proto.ScriptTarget,
jsx: 'react' as Proto.JsxEmit,
};