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

feat: allow tree shaking on design-system, use vite to build output #33

Merged
merged 6 commits into from
Apr 25, 2022

Conversation

karrui
Copy link
Collaborator

@karrui karrui commented Mar 25, 2022

Problem

This PR changes the bundler to vite (which still uses rollup under the hood, just much faster) and adds the necessary config to make the library tree-shakeable (tested only with CRA4, CRA5 has wonky behaviour with ESModules...).

Before (no tree shake):
Screenshot 2022-03-26 at 2 14 42 AM

After (tree shake):
Screenshot 2022-03-26 at 2 15 08 AM

After importing one additional component
Screenshot 2022-03-26 at 2 15 18 AM

Not fully tested yet, may not 100% work with CRA5, NextJS, etc. But for the most part it should be fine~

Loads fine with CRA4 app:
Screenshot 2022-03-26 at 2 40 51 AM

@karrui karrui requested a review from JasonChong96 March 25, 2022 18:36
@netlify
Copy link

netlify bot commented Mar 25, 2022

Deploy Preview for objective-bell-0ffbfb canceled.

Name Link
🔨 Latest commit 6dc6e2f
🔍 Latest deploy log https://app.netlify.com/sites/objective-bell-0ffbfb/deploys/623e0ba49bf7f7000818bedf

Copy link
Contributor

@JasonChong96 JasonChong96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't really have time to deeply review but code changes seem fine and it builds fine for me. Better than not having tree shake

@karrui karrui merged commit cd19951 into main Apr 25, 2022
@karrui karrui deleted the feat/tree-shake branch April 25, 2022 09:36
karrui added a commit that referenced this pull request Jun 6, 2022
…output (#33)"

This reverts commit cd19951.

# Conflicts:
#	react/package-lock.json
#	react/package.json
karrui added a commit that referenced this pull request Jun 7, 2022
* feat: inline boxicon icons, other packages

# Conflicts:
#	react/package-lock.json
#	react/package.json

* Revert "feat: allow tree shaking on design-system, use vite to build output (#33)"

This reverts commit cd19951.

# Conflicts:
#	react/package-lock.json
#	react/package.json
@karrui karrui mentioned this pull request Jun 14, 2022
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.

2 participants