nodejs / nodejs/cjs-module-lexer

literal exports not supported

Open
#6 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

edge case wontfix
Dominant language
JavaScript
Stars
262
Forks
31
Avg merge
9d 2h
Merged PRs (30d)
5

Description

As always, awesome work on this library, @guybedford :)

I'm integrating this into Snowpack to match Node.js support, and was surprised to see this limitation:
https://github.com/guybedford/cjs-module-lexer/blob/9f32d7a83a435ed6f7716318a5367a82d6480079/test/_unit.js#L317-L320

I assumed many packages would rely on this form. Is this feasible because most ESM->CJS compilers don't actually use this form in practice? Is there any support for this planned? Not sure that I'll have time to work on this myself (still some work left to do on the Snowpack integration) but mainly just curious on the background and how easy this would be to implement.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading test/_unit.js at lines 317-320 and the linked limitation around literal exports. The issue asks whether support is feasible but does not identify an implementation entry point or acceptance criteria, so the expected behavior and definition of done need clarification first.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.