rollup-plugin-enhanced-enums
v0.1.0
Published
WIP: Rollup plugin that enhances the way TypeScript enums are processed
Maintainers
Readme
Enhanced Enums
[!WARNING] This plugin is currently experimental. Use it at your own risk. There are likely a bunch of bugs that'll make your coffee machine explode. Beware of the cat. DO NOT PUT IN THE MICROWAVE.
Experimental Rollup plugin that does a much better job at inlining TypeScript enums as well as plain-js objects
annotated with JSDoc @enum.
- Does not support reverse-lookup
- Only deals with the most trivial cases for now
- Enums are exported as plain objects for use by downstream users (lib-friendly)
- Enums exported by the plugin can be further inlined by downstream users also using the plugin
- Performs very little transformation, relying on DCE instead
- Gracefully fails: if an enum hasn't been transformed, or is used dynamically, it'll still works just fine
enum,const enum, and/** @enum */all behave the same. They're always inlined where possible
