Feature Request
Is your feature request related to a problem? Please describe.
For now TypeScript will transform enum from
to
var Test;
(function (Test) {
Test[Test["Key"] = 1] = "Key";
})(Test || (Test = {}));
This result is not friendly for uglyify or tree-shaking.
When Test is not be used, the generated code block always remain as dead codes.
Describe the solution you'd like
prefer to generate codes below:
var Test = /*#__PURE__*/(function () {
var e = {}
e[e["Key"] = 1] = "Key";
return e
})();

The suggestion version will be removed.
related: microsoft/TypeScript#27604
custom plugin: https://github.com/morlay/babel-plugin-typescript-iife-enum
Feature Request
Is your feature request related to a problem? Please describe.
For now TypeScript will transform enum from
to
This result is not friendly for uglyify or tree-shaking.
When
Testis not be used, the generated code block always remain as dead codes.Describe the solution you'd like
prefer to generate codes below:
The suggestion version will be removed.
related: microsoft/TypeScript#27604
custom plugin: https://github.com/morlay/babel-plugin-typescript-iife-enum