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

Added prod & dev build scripts to reduces bundle size in production #86

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ankibalyan
Copy link
Contributor

@ankibalyan ankibalyan commented May 15, 2020

  • Loading separate file based on NODE_ENV
  • Added terser plugin for production
  • Removing PropTypes from production by using react-remove-prop-types Babel plugin
  • Removing dev specific console warning from the production build

@vercel
Copy link

vercel bot commented May 15, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/sid/react-ui/5pqa1fmre
✅ Preview: https://react-ui-git-fork-ankibalyan-build-script.sid.now.sh

@ankibalyan
Copy link
Contributor Author

Fixing #70

@ankibalyan
Copy link
Contributor Author

Minified file reaches to 32K from earlier un-minified file size of 67K.
Gzip size 9.93KB
It will also reduce further more ~3K size in production mode when it'll be added to other applications.

Copy link
Contributor

@iamdarshshah iamdarshshah left a comment

Choose a reason for hiding this comment

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

Good to go! thanks @ankibalyan

@ankibalyan
Copy link
Contributor Author

@siddharthkp added conditions for removing console warning for production build via a check for process.env.NODE_ENV !== 'production' which gets replaced at the build time..

but I'm not sure if you want to use this process.env.NODE_ENV !== 'production' specific or something like reach-ui as __DEV__.
we can't use __DEV__ as it is already being used by reach-ui components.

@ankibalyan
Copy link
Contributor Author

Also, not sure if we want to hide all the warning messages for the production build, let me know if I've to eliminate few of them.

@siddharthkp siddharthkp changed the base branch from master to main June 27, 2020 08:53
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