aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/root-helpers/plugins.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/root-helpers/plugins.ts')
-rw-r--r--client/src/root-helpers/plugins.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/client/src/root-helpers/plugins.ts b/client/src/root-helpers/plugins.ts
index 8c1c858b7..10c111a8c 100644
--- a/client/src/root-helpers/plugins.ts
+++ b/client/src/root-helpers/plugins.ts
@@ -11,8 +11,8 @@ import {
11 RegisterClientVideoFieldOptions, 11 RegisterClientVideoFieldOptions,
12 ServerConfigPlugin 12 ServerConfigPlugin
13} from '../../../shared/models' 13} from '../../../shared/models'
14import { environment } from '../environments/environment'
14import { ClientScript as ClientScriptModule } from '../types/client-script.model' 15import { ClientScript as ClientScriptModule } from '../types/client-script.model'
15import { importModule } from './utils'
16 16
17interface HookStructValue extends RegisterClientHookOptions { 17interface HookStructValue extends RegisterClientHookOptions {
18 plugin: ServerConfigPlugin 18 plugin: ServerConfigPlugin
@@ -101,7 +101,8 @@ function loadPlugin (options: {
101 101
102 console.log('Loading script %s of plugin %s.', clientScript.script, plugin.name) 102 console.log('Loading script %s of plugin %s.', clientScript.script, plugin.name)
103 103
104 return importModule(clientScript.script) 104 const absURL = (environment.apiUrl || window.location.origin) + clientScript.script
105 return import(/* webpackIgnore: true */ absURL)
105 .then((script: ClientScriptModule) => script.register({ registerHook, registerVideoField, registerSettingsScript, peertubeHelpers })) 106 .then((script: ClientScriptModule) => script.register({ registerHook, registerVideoField, registerSettingsScript, peertubeHelpers }))
106 .then(() => sortHooksByPriority(hooks)) 107 .then(() => sortHooksByPriority(hooks))
107 .catch(err => console.error('Cannot import or register plugin %s.', pluginInfo.plugin.name, err)) 108 .catch(err => console.error('Cannot import or register plugin %s.', pluginInfo.plugin.name, err))