I have a script that imports many AMD modules and calls the initialization method for each of them:
define(['underscore', './mod0', ..., './modN'], function (_) { _.each(_.toArray(arguments).slice(1), function (m) { init(m); }); });
I need to switch to the ES6 import syntax, and I'm trying to figure out if it is possible to import modules from a list, similar to my AMD code. I want to avoid madness, for example:
import mod0 from './mod0'; ... import modN from './modN'; init(mod0); ... init(modN);
Any tips on how to do this? thanks!
source share