Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(shaker): typescript enums support (#761) #764

Merged
merged 1 commit into from May 31, 2021
Merged

fix(shaker): typescript enums support (#761) #764

merged 1 commit into from May 31, 2021

Conversation

Anber
Copy link
Collaborator

@Anber Anber commented May 30, 2021

Motivation

Fix for #761

Summary

Enums are transpilled to functions with side effects, which shaker mistakenly drops.

enum Color {
  black = '#000'
}

to

var Color;
(function (Color) {
  Color["black"] = "#000";
})(Color || (Color = {}));

This PR changes the way how shaker evaluates dependencies of statements and expressions.

Test plan

One test was added, few tests were extended.

@Anber Anber merged commit 6907e22 into master May 31, 2021
@Anber Anber deleted the issue-761 branch May 31, 2021 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant