-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Labels
Description
See #1612 (comment).
Currently tree-shaking lodash-es modules is not possible with webpack 2 beta.
First clone into node_modules:
git clone -b es --depth=1 https://github.com/lodash/lodash.git ./node_modules/lodash-esthen:
npm i -g webpack@betathen:
npm i babel-loader@^5 babel-core@^5with test.js:
import { chunk } from 'lodash-es';
console.log(chunk([1,2,3,4], 2));then:
webpack ./test.js ./bundle.js -p --display-chunks --display-modules --display-origins --module-bind js=babel-loader?blacklist[]=es6.modulesis
> gzip-size bundle.js | pretty-bytes
30.41 kB
While the output of import { chunk } from 'lodash-es/array/chunk'
is
> gzip-size bundle.js | pretty-bytes
1.19 kB
Related to rollup/rollup#45
rayshan, kentcdodds, h0x91b, steve8708, teleaziz and 42 more