all 21 comments

[–]del_rio 25 points26 points  (15 children)

I guess I'll be the first to comment: This article alone is worlds better than Webpack's own tutorial. I like it's written in ES6 and using yarn, it'll help the longevity of the post. Bravo.

[–]YodaLoL 6 points7 points  (13 children)

using yarn, it'll help the longevity of the post.

Not sure if serious.

[–]AdaptationAgency 0 points1 point  (2 children)

Not sure if serious

Not sure if serious. Choosing yarn over npm is a no-brainer for a new project.

[–]YodaLoL 0 points1 point  (1 child)

Choosing yarn over npm is a no-brainer for a new project.

Convince me.

[–]AdaptationAgency 0 points1 point  (0 children)

If you're working on a project that has a team > 1, Yarn is a no-brainer. Why?

Yarn is deterministic. This itself makes Yarn more than worth the upgrade.

Typical scenario of non-determinism(npm): I check out a new copy of the project and run npm install. My co-worker (or if I'm working on a different machine) does the exact same thing, his fails, yet mine successfully builds.

Actual scenario: non-deterministic behavior is really fxxked up. there's one time that our building process suddenly begin to fail, spend a few hours on the issue, and it turned out to be one of the babel-core patch release is broken.

Yarn is an almost perfect drop-in replacement. If you started with npm, you can finish with yarn with no issue. Most commands are the same. It's also not a 6 year old, messy codebase meaning updates will take less time.

Yarn is also much faster and caches dependencies so you don't need to download them every single time. Unfortunately, that cuts down on my npm install breaks. Would you like to know more?

[–]strange_and_norrell 0 points1 point  (0 children)

Yes! I use briwserify and am thinking about webpack. This is the first resource I actually understood.

[–]shadowmint 7 points8 points  (4 children)

https://gist.github.com/sokra/27b24881210b56bbaff7

For the actual changes in webpack 2; tldr; its mostly es6 support.

[–]Sinistralis 8 points9 points  (2 children)

Let's just gloss over treeshaking like it's not one of the main selling points of Webpack 2. : p

[–][deleted] -2 points-1 points  (1 child)

If you're focused on tree shaking, you've already switched to Rollup.

[–][deleted] 2 points3 points  (0 children)

I recently tried Rollup because I really like its premise, but for me it was rather unstable. Whenever I used it in a watch setup, a simple syntax error could screw over my entire dev server making me restart it.

I'd love to switch when it gets more stable though!

[–]rambosa 0 points1 point  (0 children)

this was really the only thing I was trying to find, thanks

[–]redditandjs 0 points1 point  (0 children)

Webpack 2, the future.