mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Sandbox: Fix plugins not loading due to wrong plugin module url (#74436)
This commit is contained in:
parent
7baf9cc033
commit
f8026463a8
@ -52,7 +52,7 @@ export async function getPluginCode(meta: PluginMeta): Promise<string> {
|
||||
return pluginCode;
|
||||
} else {
|
||||
//local plugin loading
|
||||
const response = await fetch('public/' + meta.module + '.js');
|
||||
const response = await fetch(meta.module);
|
||||
let pluginCode = await response.text();
|
||||
pluginCode = patchPluginSourceMap(meta, pluginCode);
|
||||
pluginCode = patchPluginAPIs(pluginCode);
|
||||
@ -81,7 +81,7 @@ function patchPluginSourceMap(meta: PluginMeta, pluginCode: string): string {
|
||||
replaceWith += `//# sourceURL=module.js\n`;
|
||||
}
|
||||
// modify the source map url to point to the correct location
|
||||
const sourceCodeMapUrl = `/public/${meta.module}.map`;
|
||||
const sourceCodeMapUrl = meta.module + '.map';
|
||||
replaceWith += `//# sourceMappingURL=${sourceCodeMapUrl}`;
|
||||
|
||||
return pluginCode.replace('//# sourceMappingURL=module.js.map', replaceWith);
|
||||
|
Loading…
Reference in New Issue
Block a user