Closed
Description
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):
function assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
}
...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.
Metadata
Metadata
Assignees
Labels
No labels