X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Froot-helpers%2Fplugins.ts;h=10c111a8c4c593d12d6588bb66e4edce17fde923;hb=fc21ef5c62d845576a916414468b3a57370a57b2;hp=8c1c858b724c8d4d2b2f92fff02af75e76e067d7;hpb=5ec3cbdf22fc88ebe57f370fc0bc0e3df7453458;p=github%2FChocobozzz%2FPeerTube.git 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 { RegisterClientVideoFieldOptions, ServerConfigPlugin } from '../../../shared/models' +import { environment } from '../environments/environment' import { ClientScript as ClientScriptModule } from '../types/client-script.model' -import { importModule } from './utils' interface HookStructValue extends RegisterClientHookOptions { plugin: ServerConfigPlugin @@ -101,7 +101,8 @@ function loadPlugin (options: { console.log('Loading script %s of plugin %s.', clientScript.script, plugin.name) - return importModule(clientScript.script) + const absURL = (environment.apiUrl || window.location.origin) + clientScript.script + return import(/* webpackIgnore: true */ absURL) .then((script: ClientScriptModule) => script.register({ registerHook, registerVideoField, registerSettingsScript, peertubeHelpers })) .then(() => sortHooksByPriority(hooks)) .catch(err => console.error('Cannot import or register plugin %s.', pluginInfo.plugin.name, err))