diff --git a/package.json b/package.json index 1e9de44..5d433f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "weebsync", - "version": "0.7.3", + "version": "0.7.4", "description": "A small tool to automatically sync files from an ftp server.", "license": "MIT", "private": true, @@ -11,9 +11,9 @@ ], "outputPath": "dist", "targets": [ - "node16-linuxstatic", - "node16-win-x64", - "node16-mac-x64" + "node18-linuxstatic", + "node18-win-x64", + "node18-mac-x64" ] }, "scripts": { diff --git a/server/src/plugin-system.ts b/server/src/plugin-system.ts index c0ef1a3..378833c 100644 --- a/server/src/plugin-system.ts +++ b/server/src/plugin-system.ts @@ -125,11 +125,24 @@ async function loadPlugin( ) { try { const thisPluginDirectory = `${pluginDir}/${pluginFolder}`; - const plugin = ( - (await import(`${thisPluginDirectory}/index.mjs`)) as { - default: WeebsyncPlugin; - } - ).default; + let plugin: WeebsyncPlugin; + try { + plugin = ( + (await import(`${thisPluginDirectory}/index.mjs`)) as { + default: WeebsyncPlugin; + } + ).default; + } catch (e) { + applicationState.communication.logWarning( + "Could not load plugin as .mjs, trying .js now...", + ); + plugin = ( + (await import(`${thisPluginDirectory}/index.js`)) as { + default: WeebsyncPlugin; + } + ).default; + } + pluginApis[plugin.name] = { applicationState, communication: applicationState.communication,