Skip to content

Commit b7f2fd4

Browse files
crisbetodylhunn
authored andcommitted
fix(language-service): use type-only import in plugin factory (#55996)
Fixes that the plugin factory was causing TypeScript to be bundled into the language service. PR Close #55996
1 parent f8a2ad6 commit b7f2fd4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/language-service/plugin-factory.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import ts from 'typescript';
9+
// Note: use a type-only import to prevent TypeScript from being bundled in.
10+
import type ts from 'typescript';
1011

1112
import {NgLanguageService, PluginConfig} from './api';
1213

@@ -24,7 +25,7 @@ export const factory: ts.server.PluginModuleFactory = (tsModule): PluginModule =
2425
return plugin.create(info);
2526
},
2627
getExternalFiles(project: ts.server.Project): string[] {
27-
return plugin?.getExternalFiles?.(project, ts.ProgramUpdateLevel.Full) ?? [];
28+
return plugin?.getExternalFiles?.(project, tsModule.typescript.ProgramUpdateLevel.Full) ?? [];
2829
},
2930
onConfigurationChanged(config: PluginConfig): void {
3031
plugin?.onConfigurationChanged?.(config);

0 commit comments

Comments
 (0)