You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unlike regular enums, const-based enums do not have reverse mapping, and can't be referenced and indexed the same way.
Given that we're already ignoring isolatedModules behavior of not inlining const-based enums at all even within the same file, why not go a step further and transform const enum into a plain object literal? Babel's optimizeConstEnums does the following:
Unlike regular enums, const-based enums do not have reverse mapping, and can't be referenced and indexed the same way.
Given that we're already ignoring
isolatedModules
behavior of not inlining const-based enums at all even within the same file, why not go a step further and transformconst enum
into a plain object literal? Babel'soptimizeConstEnums
does the following:The size reduction from this transformation seems worthwhile for libraries trying to bundle with esbuild.
The text was updated successfully, but these errors were encountered: