diff --git a/vite.config.mts b/vite.config.mts index 6cb37579fdf..163a31e586b 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -26,6 +26,10 @@ const cdnUrls = function getPluginAliases() { const pluginsDir = path.resolve(__dirname, "apps"); + // Make sure the `apps` folder exists + if (!fs.existsSync(pluginsDir)) { + return {}; + } const pluginFolders = fs.readdirSync(pluginsDir); const aliases = {}; @@ -45,7 +49,11 @@ function getPluginAliases() { } function getPluginDependencies() { - const pluginsDir = path.resolve(__dirname, "plugins"); + const pluginsDir = path.resolve(__dirname, "apps"); + // Make sure the `apps` folder exists + if (!fs.existsSync(pluginsDir)) { + return []; + } const pluginFolders = fs.readdirSync(pluginsDir); const dependencies = new Set();