microsoft / tslib

Runtime library for TypeScript helpers.
BSD Zero Clause License
1.26k stars 128 forks source link

consider setting the __esModule marker in createExporter #27

Closed aluanhaddad closed 7 years ago

aluanhaddad commented 7 years ago

Currently, the createExporter function does not set the '__esModule' flag on the exports object.

A recent override in the jspm/registry#1040 to support this library for jspm@0.17/SystemJS@0.20 caused this package to fail under jspm@0.16/SystemJS@0.19. That issue, as reported in #26, was fixed for the latter scenario by @frankwallis in jspm/registry#1041 but naturally breaks the former scenario once again.

In attempting to find a fix that would work for both versions, I found that specifying the __esModule flag on the exports object in createExporter results in the correct behavior.

I'm not sure if this is the right way or the right place to resolve the issue.

See also https://github.com/Microsoft/TypeScript/issues/13709 and https://github.com/systemjs/systemjs/issues/1587