esperantojs / esperanto

DEPRECATED: An easier way to convert ES6 modules to AMD and CommonJS
http://esperantojs.org
234 stars 21 forks source link

Mixed default & named imports #111

Closed ef4 closed 9 years ago

ef4 commented 9 years ago

Esperanto currently supports:

import { default as Foo, bar } from "my-module";

But the spec-compliant way to do this is:

import Foo, { bar } from "my-module";
rwjblue commented 9 years ago

Looks like this is supported now. Just tested in the live demo.

Input:

import Foo, { blah } from 'bar';

new Foo();
blah + 1

Output:

define(['bar'], function (bar) {

    'use strict';

    new bar['default']();
    bar.blah + 1

});
eventualbuddha commented 9 years ago

Closing since as far as I can tell this is working correctly.