diff --git a/start.js b/start.js index 60f722be..c71a338b 100755 --- a/start.js +++ b/start.js @@ -85,7 +85,7 @@ async function preloadESModules (opts) { if (typeof opts.import === 'string') { opts.import = [opts.import] } - opts.import.forEach(async (m) => { + await Promise.all(opts.import.map(async (m) => { if (m) { /* This check ensures we ignore `-i ""`, trailing `-i`, or * other silly things the user might (inadvertently) be doing. @@ -96,7 +96,7 @@ async function preloadESModules (opts) { module.exports.stop(e) } } - }) + })) } async function runFastify (args, additionalOptions, serverOptions, serverModule) {