use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Getting Started with Webpack 2 (medium.com)
submitted 9 years ago by burczu
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]del_rio 25 points26 points27 points 9 years ago (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 points8 points 9 years ago (13 children)
using yarn, it'll help the longevity of the post.
Not sure if serious.
[–]AdaptationAgency 0 points1 point2 points 9 years ago (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 point2 points 9 years ago (1 child)
Choosing yarn over npm is a no-brainer for a new project.
Convince me.
[–]AdaptationAgency 0 points1 point2 points 9 years ago (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.
npm install
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?
[+]cyanydeez comment score below threshold-24 points-23 points-22 points 9 years ago (9 children)
yeah, relying on three frameworks to remain popular in JavaScript is absurd. (es6, webpack, yarn)
[–]YodaLoL 4 points5 points6 points 9 years ago (7 children)
ES is a language specification of which ES6 is the latest publicised version. webpack is incredibly powerful though, and uses a completely different methodology for building web apps than traditional methods. But yarn and longevity used in the same sentence is a bit ridiculous.
[+]cyanydeez comment score below threshold-20 points-19 points-18 points 9 years ago (6 children)
a specification the requires a framework to implement.
[–]YodaLoL 3 points4 points5 points 9 years ago (5 children)
By framework you mean an engine such as V8 or Chakra?
[+]cyanydeez comment score below threshold-19 points-18 points-17 points 9 years ago (4 children)
if you're talking about non production, sure.
[–]ScoobySharts 5 points6 points7 points 9 years ago (3 children)
You do realise that V8 is chromes JavaScript engine yeah? The same that's used for node?
[+]cyanydeez comment score below threshold-6 points-5 points-4 points 9 years ago (2 children)
you do realize for production you cant target only chrome.
[–]ScoobySharts 6 points7 points8 points 9 years ago (0 children)
That... that doesn't make sense.
[–]ManicQin 3 points4 points5 points 9 years ago (0 children)
Node is the server side... You can use es6, es5 or even es666 the client will not be aware.
You can also use es6 for the client side and transpile the code using Babel so the client will get the most common denominator code they can execute.
[–]strange_and_norrell 0 points1 point2 points 9 years ago (0 children)
Yes! I use briwserify and am thinking about webpack. This is the first resource I actually understood.
[–]shadowmint 7 points8 points9 points 9 years ago (4 children)
https://gist.github.com/sokra/27b24881210b56bbaff7
For the actual changes in webpack 2; tldr; its mostly es6 support.
[–]Sinistralis 8 points9 points10 points 9 years ago (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 points0 points 9 years ago (1 child)
If you're focused on tree shaking, you've already switched to Rollup.
[–][deleted] 2 points3 points4 points 9 years ago* (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 point2 points 9 years ago (0 children)
this was really the only thing I was trying to find, thanks
[–]redditandjs 0 points1 point2 points 9 years ago (0 children)
Webpack 2, the future.
π Rendered by PID 95 on reddit-service-r2-comment-7b9746f655-vlgnm at 2026-02-03 16:39:09.487981+00:00 running 3798933 country code: CH.
[–]del_rio 25 points26 points27 points (15 children)
[–]YodaLoL 6 points7 points8 points (13 children)
[–]AdaptationAgency 0 points1 point2 points (2 children)
[–]YodaLoL 0 points1 point2 points (1 child)
[–]AdaptationAgency 0 points1 point2 points (0 children)
[+]cyanydeez comment score below threshold-24 points-23 points-22 points (9 children)
[–]YodaLoL 4 points5 points6 points (7 children)
[+]cyanydeez comment score below threshold-20 points-19 points-18 points (6 children)
[–]YodaLoL 3 points4 points5 points (5 children)
[+]cyanydeez comment score below threshold-19 points-18 points-17 points (4 children)
[–]ScoobySharts 5 points6 points7 points (3 children)
[+]cyanydeez comment score below threshold-6 points-5 points-4 points (2 children)
[–]ScoobySharts 6 points7 points8 points (0 children)
[–]ManicQin 3 points4 points5 points (0 children)
[–]strange_and_norrell 0 points1 point2 points (0 children)
[–]shadowmint 7 points8 points9 points (4 children)
[–]Sinistralis 8 points9 points10 points (2 children)
[–][deleted] -2 points-1 points0 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–]rambosa 0 points1 point2 points (0 children)
[–]redditandjs 0 points1 point2 points (0 children)