From dc5d22f503bffebb92375d5d073715442b5650d5 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Mon, 4 Dec 2023 15:05:52 +0100 Subject: [PATCH] MOBILE-3947 core: Don't include angular/compiler in main bundle --- src/core/features/compile/services/compile.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/features/compile/services/compile.ts b/src/core/features/compile/services/compile.ts index d609d5877..d8c475ae1 100644 --- a/src/core/features/compile/services/compile.ts +++ b/src/core/features/compile/services/compile.ts @@ -160,8 +160,6 @@ import { CorePromisedValue } from '@classes/promised-value'; import { CorePlatform } from '@services/platform'; import { CoreAutoLogoutService } from '@features/autologout/services/autologout'; -import '@angular/compiler'; - /** * Service to provide functionalities regarding compiling dynamic HTML and Javascript. */ @@ -206,6 +204,8 @@ export class CoreCompileProvider { viewContainerRef: ViewContainerRef, extraImports: any[] = [], // eslint-disable-line @typescript-eslint/no-explicit-any ): Promise | undefined> { + // Import the Angular compiler to be able to compile components in runtime. + await import('@angular/compiler'); // Create the component using the template and the class. const component = Component({ template })(componentClass);