esperantojs / esperanto

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

Shorthand property references are broken #183

Closed jamiebuilds closed 8 years ago

jamiebuilds commented 9 years ago
import foo from 'foo';

export default {
  foo
}

foo might be named like _foo but the object property shorthand is left as is.

Related Issue: https://github.com/marionettejs/backbone-metal/issues/28 Related Commit: https://github.com/marionettejs/backbone-metal/commit/4cfec964ec8776165377292314d0174cf08a1aa2

szwacz commented 9 years ago

What you are talking about here is different ES6 feature which just happens to be used with export in your case. Esperanto is responsible only for transpiling modules.

jamiebuilds commented 9 years ago

What you are talking about here is different ES6 feature which just happens to be used with export

Yes I'm well aware of that.

Esperanto is responsible only for transpiling modules.

It's also responsible for transpiling the references it creates, so this falls well within the responsibility of esperanto. I'm not asking for it to transpile all shorthand properties, just the ones it needs to in order to actually work.

Rich-Harris commented 9 years ago

Yep, this definitely qualifies as a bug. Lord knows when I'll have time to address it properly... PRs gladly accepted in the meantime :blush:

Rich-Harris commented 9 years ago

This will now be fixed in 0.8.0 (see #184), but my recommendation would be to use Rollup directly instead.

jamiebuilds commented 8 years ago

Clearing out old issues, closing for inactivity