-
Notifications
You must be signed in to change notification settings - Fork 808
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
Reduce build size by swapping out lodash.assign for a minimal Object.assign #332
Milestone
Comments
In this case since only |
claydiffrient
added a commit
that referenced
this issue
Mar 5, 2017
This commit sets things up to work properly when publishing to npm. Prior to publishing the package items from the src/ folder will be processed with Babel and stored in the lib/ folder. The lib/ folder will not be present in the repository. The src/ folder similarly will not be available when looking at the installed package. In addition this commit also fixes #332 by adding the `babel-plugin-transform-object-assign` plugin and removing `lodash.assign`
claydiffrient
added a commit
that referenced
this issue
Mar 5, 2017
This commit sets things up to work properly when publishing to npm. Prior to publishing the package items from the src/ folder will be processed with Babel and stored in the lib/ folder. The lib/ folder will not be present in the repository. The src/ folder similarly will not be available when looking at the installed package. In addition this commit also fixes #332 by adding the `babel-plugin-transform-object-assign` plugin and removing `lodash.assign`
claydiffrient
added a commit
that referenced
this issue
Mar 24, 2017
* Update bundling scheme This commit sets things up to work properly when publishing to npm. Prior to publishing the package items from the src/ folder will be processed with Babel and stored in the lib/ folder. The lib/ folder will not be present in the repository. The src/ folder similarly will not be available when looking at the installed package. In addition this commit also fixes #332 by adding the `babel-plugin-transform-object-assign` plugin and removing `lodash.assign` * Update linting dependencies This temporarily disables react/require-default-props until it can be addressed in a separate commit. * Make sure tests run using the proper source
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I did a clone of the repo followed by
NODE_ENV=production scripts/build
, which produced a 16826 bytes react-modal.min.js (5358 bytes gzipped).Replacing the lodash assign import in ModalPortal.js with a minimal Object.assign polyfill (I took the TS one just for example):
...produced a 14516 bytes react-modal.min.js (4418 bytes gzipped).
That's an 18% (gzipped size) reduction, which adds up on slow networks and devices.
The text was updated successfully, but these errors were encountered: