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

How to tree shake? #4

Closed
eoghanmurray opened this issue Jul 15, 2023 · 1 comment
Closed

How to tree shake? #4

eoghanmurray opened this issue Jul 15, 2023 · 1 comment

Comments

@eoghanmurray
Copy link

I've imported parseDeclarations in order to parse the style attributes of elements.

The style attributes are much more limited and can't e.g. include @media rules or anything, however in the build, classes like AtCustomMedia get included.

Is there any way to tree shake these out of the final build? I'm not familiar with how best to do that or what I should turn on to do so, and maybe it depends on my build process (see the other tickets).

The result is an extra 184K of code which almost doubles the amount of code of the project that I'm working on which won't be a goer!

@matthias-christen
Copy link
Member

If you import directly from the src folder into your TypeScript project using the v1.0.3 release, your bundler should be able to tree-shake, if you only need parseDeclarations.

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

No branches or pull requests

2 participants