mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-23 00:13:13 +09:00
Fix broken manifest url resolution
This commit is contained in:
1 file changed
+5
-3
@@ -1133,11 +1133,13 @@ export default class Controller {
|
|||||||
for (let pluginInfo of this.pluginInfos) {
|
for (let pluginInfo of this.pluginInfos) {
|
||||||
try {
|
try {
|
||||||
const manifestPath = path.posix.join(pluginInfo.requirePath, "dist", "web", "manifest.json");
|
const manifestPath = path.posix.join(pluginInfo.requirePath, "dist", "web", "manifest.json");
|
||||||
const resolvedManifestPath = fileURLToPath(import.meta.resolve(manifestPath));
|
const resolvedUrl = import.meta.resolve(manifestPath);
|
||||||
pluginInfo.manifest = await Controller.loadJsonObject(resolvedManifestPath, true);
|
const resolvedPath = resolvedUrl.startsWith('file://') ? fileURLToPath(resolvedUrl) : resolvedUrl;
|
||||||
|
pluginInfo.manifest = await Controller.loadJsonObject(resolvedPath, true);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (lib.pluginNeedsWebBuild(pluginInfo)) {
|
if (lib.pluginNeedsWebBuild(pluginInfo)) {
|
||||||
logger.warn(`Unable to load dist/web/manifest.json for plugin ${pluginInfo.name}`);
|
const stack = (err as Error).stack ?? (err as Error).message;
|
||||||
|
logger.warn(`Unable to load dist/web/manifest.json for plugin ${pluginInfo.name}\n${stack}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user