diff options
Diffstat (limited to 'client/src/app/core/plugins/plugin.service.ts')
-rw-r--r-- | client/src/app/core/plugins/plugin.service.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/client/src/app/core/plugins/plugin.service.ts b/client/src/app/core/plugins/plugin.service.ts index 3bb82e8a9..3af36765a 100644 --- a/client/src/app/core/plugins/plugin.service.ts +++ b/client/src/app/core/plugins/plugin.service.ts | |||
@@ -18,6 +18,7 @@ import { PublicServerSetting } from '@shared/models/plugins/public-server.settin | |||
18 | import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils' | 18 | import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils' |
19 | import { RegisterClientHelpers } from '../../../types/register-client-option.model' | 19 | import { RegisterClientHelpers } from '../../../types/register-client-option.model' |
20 | import { PluginTranslation } from '@shared/models/plugins/plugin-translation.model' | 20 | import { PluginTranslation } from '@shared/models/plugins/plugin-translation.model' |
21 | import { importModule } from '@app/shared/misc/utils' | ||
21 | 22 | ||
22 | interface HookStructValue extends RegisterClientHookOptions { | 23 | interface HookStructValue extends RegisterClientHookOptions { |
23 | plugin: ServerConfigPlugin | 24 | plugin: ServerConfigPlugin |
@@ -222,7 +223,7 @@ export class PluginService implements ClientHook { | |||
222 | console.log('Loading script %s of plugin %s.', clientScript.script, plugin.name) | 223 | console.log('Loading script %s of plugin %s.', clientScript.script, plugin.name) |
223 | 224 | ||
224 | return this.zone.runOutsideAngular(() => { | 225 | return this.zone.runOutsideAngular(() => { |
225 | return import(/* webpackIgnore: true */ clientScript.script) | 226 | return importModule(clientScript.script) |
226 | .then((script: ClientScriptModule) => script.register({ registerHook, peertubeHelpers })) | 227 | .then((script: ClientScriptModule) => script.register({ registerHook, peertubeHelpers })) |
227 | .then(() => this.sortHooksByPriority()) | 228 | .then(() => this.sortHooksByPriority()) |
228 | .catch(err => console.error('Cannot import or register plugin %s.', pluginInfo.plugin.name, err)) | 229 | .catch(err => console.error('Cannot import or register plugin %s.', pluginInfo.plugin.name, err)) |