From 07032374414ad91a86d1878d7134a1cc6e324952 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Tue, 12 Jun 2018 19:11:25 +0200 Subject: [PATCH] MOBILE-2163 compile: Decrease addon components in compile --- gulpfile.js | 4 ++-- src/core/compile/providers/compile.ts | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 3561eb76d..7994ecc06 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -292,8 +292,8 @@ var templatesSrc = [ './src/components/**/*.html', './src/core/**/components/**/*.html', './src/core/**/component/**/*.html', - './src/addon/**/components/**/*.html', - './src/addon/**/component/**/*.html' + // Only some addon components are injected to compile to decrease load time. Copy only the ones that are needed. + './src/addon/mod/assign/components/**/*.html' ], templatesDest = './www/templates'; diff --git a/src/core/compile/providers/compile.ts b/src/core/compile/providers/compile.ts index fc4825efc..ec515a010 100644 --- a/src/core/compile/providers/compile.ts +++ b/src/core/compile/providers/compile.ts @@ -114,10 +114,7 @@ import { ADDON_PUSHNOTIFICATIONS_PROVIDERS } from '@addon/pushnotifications/push import { ADDON_REMOTETHEMES_PROVIDERS } from '@addon/remotethemes/remotethemes.module'; // Import some addon modules that define components, directives and pipes. Only import the important ones. -import { AddonMessagesComponentsModule } from '@addon/messages/components/components.module'; import { AddonModAssignComponentsModule } from '@addon/mod/assign/components/components.module'; -import { AddonModForumComponentsModule } from '@addon/mod/forum/components/components.module'; -import { AddonNotificationsComponentsModule } from '@addon/notifications/components/components.module'; /** * Service to provide functionalities regarding compiling dynamic HTML and Javascript. @@ -138,9 +135,7 @@ export class CoreCompileProvider { protected IMPORTS = [ IonicModule, TranslateModule.forChild(), CoreComponentsModule, CoreDirectivesModule, CorePipesModule, CoreCourseComponentsModule, CoreCoursesComponentsModule, CoreSiteHomeComponentsModule, CoreUserComponentsModule, - CoreCourseDirectivesModule, CoreSitePluginsDirectivesModule, CoreQuestionComponentsModule, AddonMessagesComponentsModule, - AddonModAssignComponentsModule, AddonModForumComponentsModule, - AddonNotificationsComponentsModule + CoreCourseDirectivesModule, CoreSitePluginsDirectivesModule, CoreQuestionComponentsModule, AddonModAssignComponentsModule, ]; constructor(protected injector: Injector, logger: CoreLoggerProvider, compilerFactory: JitCompilerFactory) {