Skip to content

Commit 68d11b2

Browse files
authored
Merge pull request #385 from KristjanESPERANTO/functions
docs(introduction): clarify usage of functions in config.js for browser availability
2 parents 6f37dcb + 495c767 commit 68d11b2

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

configuration/introduction.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
},
2020
],
2121
};
22+
23+
/*************** DO NOT EDIT THE LINE BELOW ***************/
24+
if (typeof module !== "undefined") {module.exports = config;}
2225
```
2326

2427
See [module configuration](/modules/configuration) for more information and
@@ -96,6 +99,11 @@ debugging:
9699
server security header behavior.
97100
- `hideConfigSecrets` is documented in detail in [Secrets](./secrets).
98101

102+
When you use functions in `config.js`, keep them inside the exported `config`
103+
object if they need to be available in the browser. MagicMirror² serves the
104+
browser copy of the configuration from the `config` object, so free-standing
105+
helper functions outside that object are not included there.
106+
99107
#### Bash Environment variables
100108

101109
There are two environment variables that override part or all of config.js. They

0 commit comments

Comments
 (0)