CommonJS support #4215
Replies: 4 comments 3 replies
-
The ideal solution is one that wraps the official package and exposes it as a CJS module without requiring any changes in the official package. The rationale is 2-fold:
|
Beta Was this translation helpful? Give feedback.
-
The solution could be as lightweight as providing a sample project for exposing antlr + generated parsers as a CJS package. We can then include that sample in the docs. |
Beta Was this translation helpful? Give feedback.
-
see #4217 |
Beta Was this translation helpful? Give feedback.
-
see #4199 |
Beta Was this translation helpful? Give feedback.
-
Currently antlr only supports ESM.
This is an issue for developers tied to now legacy CommonJS
The problem to solve is more complex for antlr than for most libraries, because antlr generates code for ESM only, not for CJS. If a solution can be identified that is lightweight enough and non-destructive we will consider it.
This discussion is about that (and only that).
Please don't submit PRs until this discussion reaches some level of approval from antlr org (they will be redirected here).
Beta Was this translation helpful? Give feedback.
All reactions