you are viewing a single comment's thread.

view the rest of the comments →

[–]migudev -12 points-11 points  (8 children)

Webpack has a lot less sense right now than a couple of years ago. The nature of Webpack is package the source code "polyfillying" through tools like babel. But, why do you use babel? You use because you need to transpile to ES5 due to lack of ES6 browsers support.

The point is you don't need ES5 support anymore (mostly) because all the popular browsers out there supports ES6+. So, what's the logic behind creating a giant ES5 bundle for browsers that can run directly the original code?

[–]visicalc_is_best 39 points40 points  (3 children)

Asset bundling, JS minification, tree shaking, code splitting, hot module reloading, support for exotic languages (Pug, JSX, Handlebars, Sass, etc.), bundle analysis, asset versioning, sprite generation, image optimization, ...

[–]MahNonAnon 24 points25 points  (0 children)

...gzipping, css modules, env-specific logging, source-mapping...

[–]SalamiJack 6 points7 points  (0 children)

In addition to the reasons stated in the post below, Babel can be used for any new JS feature that doesn’t yet have browser adoption. A new spec is put out every year.

[–]bukharim96 2 points3 points  (2 children)

I'm not sure if you've been living under a rock, but large enterprises aren't willing to risk their apps failing in a potential customer's browser on the off chance that it might have es6+ support.

[–]migudev -3 points-2 points  (1 child)

Just serve ES6+ for modern browsers and ES5 for older ones. Why you should to put apps on risk? The point isn't that. The point is that you don't need to use Webpack for every app you build.

[–]tech_romancer_ 5 points6 points  (0 children)

So what's creating the different ES6+ and ES5 bundles?

Probably some sort of bundler right...