dynamic synchronous import

Brendan Eich brendan at mozilla.org
Fri Sep 26 09:06:08 PDT 2014


Konstantin Ikonnikov wrote:
> Can I import module dynamically, but synchronously? Example for common js
>
> ```js
> var moduleName = 'foo';
> var foo = require(moduleName);
> ```

You can't do that in the browser, as followups point out. Do you use 
browserify or similar to make this seem to work? If so, that's not 
dynamic-synch.

/be


More information about the es-discuss mailing list