Export the enums from the main entrypoint #64
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Previously, the enums were exported from an additional file,
./dist/constants, which was a problem for some bundlers like esbuild because the./dist/constantsentrypoint isn't declared in the package.json. After reexporting them from the main entrypoint I found out that it still didn't work right because esbuild can't inline const enums across packages (and frankly, I wouldn't expect it to). Thus, I've changed enums to regular ones and exported them from the index, and now the generator package builds correctly with my PR for UnpluginThese enums aren't public. What are you doing that needs access to them?
The
@lezer/generatorpackage is accessing themYes, and its build system can handle that.
Wouldn't it be better if any build system could handle that? Are there any downsides to the solution I proposed?
Yes. It makes these enums non-const, changes things around, without addressing anything I actually consider a problem.
Pull request closed