News for hackers. Stuff that matters.
Re:Webpack 2, RC 7 by Vevolut on Monday January 16, 2017 @02:05PM (#13412074)
Except in my experience (and others as well) the tree shaking hasn't been working.
Re:Webpack 2, RC 7 by frio on Monday January 16, 2017 @03:59PM (#13412956)
The problem with tree-shaking is that it's recursive -- every module has to do it properly, and at the moment, I'd wager most frontend modules in NPM don't.

If I responsibly say `import { map } from 'lodash'`;, but (say) my frontend rendering library says `import _ from 'lodash'; _.map(things, func);`, then unfortunately, transitively, I'll still get all of lodash.

Re:Webpack 2, RC 7 by jdd on Friday January 20, 2017 @05:31PM (#13447511)
You might be able to fix that with something like babel-plugin-lodash which can be ran over your code (and deps) to enforce cherry-picking across the board.

https://github.com/lodash/babel-plugin-lodash

Re:Webpack 2, RC 7 by frio on Sunday January 22, 2017 @09:26PM (#13459226)
Late reply, but, neat! I'll have a look.
Re:Webpack 2, RC 7 by boubiyeah on Monday January 16, 2017 @03:23PM (#13412697)
Strange, I have it working with rc3. I have an ES6 module exporting tons of Array utils. I definitely see the build size fluctuate depending on whether I import 1, 2, etc of these util functions, whether with webpack 1 (or most bundling tool apart from rollup) I would pay the entire file's price upfront.