Skip to content

Commit

Permalink
removed config.paths.vendor and renamed config.paths.modules to c…
Browse files Browse the repository at this point in the history
…onfig.foreignModulesDir`
  • Loading branch information
khassel committed Sep 11, 2024
1 parent 7272905 commit 809a1ca
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 2 additions & 6 deletions js/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down Expand Up @@ -72,12 +73,7 @@ const defaults = {
text: "www.michaelteeuw.nl"
}
}
],

paths: {
modules: "modules",
vendor: "vendor"
}
]
};

/*************** DO NOT EDIT THE LINE BELOW ***************/
Expand Down
2 changes: 1 addition & 1 deletion js/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion js/server_functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}/`, "");
}
Expand Down

0 comments on commit 809a1ca

Please sign in to comment.