fix: remote plugin (#2831)

This commit is contained in:
jack zhang 2023-10-14 10:19:10 +08:00 committed by GitHub
parent 166521bcdb
commit 3510506db3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -31,7 +31,7 @@ export function getRemotePlugins(requirejs: any, pluginData: PluginData[] = []):
requirejs.requirejs.config({ requirejs.requirejs.config({
waitSeconds: 120, waitSeconds: 120,
paths: pluginData.reduce<Record<string, string>>((acc, cur) => { paths: pluginData.reduce<Record<string, string>>((acc, cur) => {
acc[cur.packageName] = `${cur.url}?noExt`; acc[cur.packageName] = cur.url;
return acc; return acc;
}, {}), }, {}),
}); });

View File

@ -4,6 +4,8 @@ import path from 'path';
import Application from '../../application'; import Application from '../../application';
import { getExposeUrl } from '../clientStaticUtils'; import { getExposeUrl } from '../clientStaticUtils';
import PluginManager from '../plugin-manager'; import PluginManager from '../plugin-manager';
//@ts-ignore
import { version } from '../../../package.json';
export default { export default {
name: 'pm', name: 'pm',
@ -129,7 +131,7 @@ export default {
try { try {
return { return {
...item.toJSON(), ...item.toJSON(),
url: getExposeUrl(item.packageName, PLUGIN_CLIENT_ENTRY_FILE), url: `${getExposeUrl(item.packageName, PLUGIN_CLIENT_ENTRY_FILE)}?version=${version}`,
}; };
} catch { } catch {
return false; return false;