cordova-elm-template-jumpstart
Version:
Cordova template to jumpstart development using Elm and Webpack
31 lines (26 loc) • 956 B
JavaScript
/*
* This file wires together the initialization that needs to happen before
* Elm can get launched. To add additional initialization steps, move a
* JavaScript file into the ./init.d folder that is a sibling to this file.
* */
import Promise from "bluebird";
const requireInit = require.context(
"./init.d", // The name of the folder that contains our init scripts
true, // Whether or not to include subfolders
/\.js$/i // The regex the file name must match in order to be included as an init script
);
module.exports = Promise.try(
() => console.info("Starting init scripts")
).then(
() => requireInit.keys()
).map(initScript =>
Promise.try(
() => console.info("Starting init script => " + initScript)
).then(
() => requireInit(initScript)
).finally(
() => console.info("Finished init script => " + initScript)
)
).all().finally(
() => console.info("Finished running all init scripts")
).return(true);