Skip to content

Consider supporting __esModule flag on CommonJS #496

@guybedford

Description

@guybedford

CommonJS modules that have the defineProperty(exports, '__esModule', { value: true }) thing could potentially be inferred as ES modules automatically in Rollup, and their exports bindings treated as such. Almost a sort of reverse CommonJS -> ES6 transformation. This would allow any modules transpiled with Babel into CommonJS to support Rollup optimizations due to their bindings nature.

This would greatly improve Rollup's ability to inline modules, as a sort of alternative to the jsnext:main thing.

Just sending the idea along though, feel free to close.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions