esperantojs / esperanto

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

fixes a bug with default export assignments that clash #117

Closed Rich-Harris closed 9 years ago

Rich-Harris commented 9 years ago

Just ran into an awkward case where names would clash:

// foo.js
export default notActuallyFoo;

function notActuallyFoo() {}
function foo() {}

This would get var foo = notActuallyFoo added to the top of the module within the bundle, which obviously clashes. A neater solution would be to rewrite references to that export in other modules as notActuallyFoo rather than having to alias it for their benefit, but that opens a whole nother can of worms that I don't have time for right now.