Skip to content

[@rollup/plugin-commonjs] commonjs does not recognize named cjs exports #1678

@GauBen

Description

@GauBen

I'm trying to transpile CJS to ESM until prisma/prisma#5030 is addressed. I'm having a hard time doing so as I can't quite get the pieces together.

Expected Behavior

The commonjs plugin properly detects all named exports

Actual Behavior

No named exports are found

Additional Information

There is a node-backed package that does a pretty solid named exports analysis, which works for my specific use case. I've added a npm run cjs-lex command in the repro to show how it works

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