MCPcopy Index your code
hub / github.com/MagicMirrorOrg/MagicMirror / bootstrapModule

Function bootstrapModule

js/loader.js:171–185  ·  view source on GitHub ↗

* Bootstrap modules by setting the module data and loading the scripts & styles. * @param {object} module Information about the module we want to load. * @param {Module} mObj Modules instance.

(module, mObj)

Source from the content-addressed store, hash-verified

169 * @param {Module} mObj Modules instance.
170 */
171async function bootstrapModule (module, mObj) {
172 Log.info(`Bootstrapping module: ${module.name}`);
173 mObj.setData(module);
174
175 await mObj.loadScripts();
176 Log.log(`Scripts loaded for: ${module.name}`);
177
178 await mObj.loadStyles();
179 Log.log(`Styles loaded for: ${module.name}`);
180
181 await mObj.loadTranslations();
182 Log.log(`Translations loaded for: ${module.name}`);
183
184 moduleObjects.push(mObj);
185}
186
187/**
188 * Load a script or stylesheet by adding it to the dom.

Callers 1

afterLoadFunction · 0.85

Calls 4

setDataMethod · 0.80
loadScriptsMethod · 0.80
loadStylesMethod · 0.80
loadTranslationsMethod · 0.80

Tested by

no test coverage detected