TC39 vs "the community"

Juan Ignacio Dopazo jdopazo at
Fri Jun 20 16:11:39 PDT 2014

On Friday, June 20, 2014 7:15 PM, Andrea Giammarchi <andrea.giammarchi at> wrote:
typo ...

var require = function (fromWhere) {
  return  import * from fromWhere

That's not valid ES6. It's specified that:

- Import and export statements can only be top level statements
- The module name must be a string literal.
- Import * is not specified.

ES6 modules are designed to be static. So no, you can't use import statements under the hood in require(). But you can set up things so that you can use "import" to import CommonJS modules.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list