Open kenany opened 7 years ago
This patch introduces the babel-plugin-lodash plugin in order to rewrite the lodash imports from, say:
babel-plugin-lodash
lodash
import _ from 'lodash'; export default function(func) { return _.isFunction(func) && func.name === 'debounced'; }
to:
import isFunction from 'lodash/isFunction'; export default function(func) { return isFunction(func) && func.name === 'debounced'; }
This helps to reduce bundle size. Bundle size before patch:
$ browserify lib | gzip -9 | wc -c | pretty-bytes 132 kB
Bundle size with this patch:
$ browserify lib | gzip -9 | wc -c | pretty-bytes 62.9 kB
Fixes https://github.com/gmcquistin/react-throttle/issues/5
Rebased.
Without patch:
$ browserify lib | gzip -9 | wc -c | pretty-bytes 117 kB
With patch:
$ browserify lib | gzip -9 | wc -c | pretty-bytes 48.1 kB
This patch introduces the
babel-plugin-lodash
plugin in order to rewrite thelodash
imports from, say:to:
This helps to reduce bundle size. Bundle size before patch:
Bundle size with this patch:
Fixes https://github.com/gmcquistin/react-throttle/issues/5