diff --git a/CHANGELOG.md b/CHANGELOG.md index 708957cf4a..e9b5f0948c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,8 +11,9 @@ _This release is scheduled to be released on 2024-10-01._ ### Added +- [core] removed `config.paths.vendor` (could not work because `vendor` is hardcoded in `index.html`), renamed `config.paths.modules` to `config.foreignModulesDir` - [core] add variable `MM_CUSTOMCSS_FILE` which - if set - overrides `config.customCss` -- [core] add variable `MM_MODULES_DIR` which - if set - overrides `config.paths.modules` for foreign modules (not default modules) +- [core] add variable `MM_MODULES_DIR` which - if set - overrides `config.foreignModulesDir` ### Removed diff --git a/js/defaults.js b/js/defaults.js index c4efa77e95..f3a894d6a9 100644 --- a/js/defaults.js +++ b/js/defaults.js @@ -19,6 +19,7 @@ const defaults = { units: "metric", zoom: 1, customCss: "css/custom.css", + foreignModulesDir: "modules", // httpHeaders used by helmet, see https://helmetjs.github.io/. You can add other/more object values by overriding this in config.js, // e.g. you need to add `frameguard: false` for embedding MagicMirror in another website, see https://github.com/MagicMirrorOrg/MagicMirror/issues/2847 httpHeaders: { contentSecurityPolicy: false, crossOriginOpenerPolicy: false, crossOriginEmbedderPolicy: false, crossOriginResourcePolicy: false, originAgentCluster: false }, @@ -72,12 +73,7 @@ const defaults = { text: "www.michaelteeuw.nl" } } - ], - - paths: { - modules: "modules", - vendor: "vendor" - } + ] }; /*************** DO NOT EDIT THE LINE BELOW ***************/ diff --git a/js/loader.js b/js/loader.js index 362f3690ff..02a18d44de 100644 --- a/js/loader.js +++ b/js/loader.js @@ -256,7 +256,7 @@ const Loader = (function () { // This file is available in the vendor folder. // Load it from this vendor folder. loadedFiles.push(fileName.toLowerCase()); - return loadFile(`${config.paths.vendor}/${vendor[fileName]}`); + return loadFile(`vendor/${vendor[fileName]}`); } // File not loaded yet. diff --git a/js/server_functions.js b/js/server_functions.js index a470fe0900..d1b039f31e 100644 --- a/js/server_functions.js +++ b/js/server_functions.js @@ -133,7 +133,7 @@ function getVersion (req, res) { * @returns {object} environment variables key: values */ function getEnvVarsAsObj () { - const obj = { modulesDir: `${config.paths.modules}`, customCss: `${config.customCss}` }; + const obj = { modulesDir: `${config.foreignModulesDir}`, customCss: `${config.customCss}` }; if (process.env.MM_MODULES_DIR) { obj.modulesDir = process.env.MM_MODULES_DIR.replace(`${global.root_path}/`, ""); }