Need advice about which tool to choose?Ask the StackShare community!

Babel

11.9K
7.4K
+ 1
389
Webpack

25.9K
17.8K
+ 1
750
Add tool

Babel vs Webpack: What are the differences?

Babel: Use next generation JavaScript, today. Babel will turn your ES6+ code into ES5 friendly code, so you can start using it right now without waiting for browser support; Webpack: A bundler for javascript and friends. A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows to load parts for the application on demand. Through "loaders" modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.

Babel can be classified as a tool in the "JavaScript Compilers" category, while Webpack is grouped under "JS Build Tools / JS Task Runners".

"Modern Javascript works with all browsers", "Open source" and "Integration with lots of tools" are the key factors why developers consider Babel; whereas "Most powerful bundler", "Built-in dev server with livereload" and "Can handle all types of assets" are the primary reasons why Webpack is favored.

Babel and Webpack are both open source tools. It seems that Webpack with 49.5K GitHub stars and 6.22K forks on GitHub has more adoption than Babel with 33.5K GitHub stars and 3.57K GitHub forks.

According to the StackShare community, Webpack has a broader approval, being mentioned in 2180 company stacks & 1297 developers stacks; compared to Babel, which is listed in 887 company stacks and 661 developer stacks.

Decisions about Babel and Webpack
Aleksandr Filatov
Contract Software Engineer - Microsoft · | 0 upvote · 72.8K views
Why migrated?

I could define the next points why we have to migrate:

  • Decrease build time of our application. (It was the main cause).
  • Also jspm install takes much more time than npm install.
  • Many config files for SystemJS and JSPM. For Webpack you can use just one main config file, and you can use some separate config files for specific builds using inheritance and merge them.
See more

We mostly use rollup to publish package onto NPM. For most all other use cases, we use the Meteor build tool (probably 99% of the time) for publishing packages. If you're using Node on FHIR you probably won't need to know rollup, unless you are somehow working on helping us publish front end user interface components using FHIR. That being said, we have been migrating away from Atmosphere package manager towards NPM. As we continue to migrate away, we may publish other NPM packages using rollup.

See more
Get Advice from developers at your company using Private StackShare. Sign up for Private StackShare.
Learn More
Pros of Babel
Pros of Webpack
  • 163
    Modern Javascript works with all browsers
  • 77
    Open source
  • 60
    Integration with lots of tools
  • 56
    Easy setup
  • 26
    Very active on github
  • 2
    Love
  • 2
    JSX
  • 2
    Source maps
  • 1
    Extensions
  • 308
    Most powerful bundler
  • 182
    Built-in dev server with livereload
  • 143
    Can handle all types of assets
  • 87
    Easy configuration
  • 20
    Laravel-mix
  • 4
    Overengineered, Underdeveloped
  • 2
    Makes it easy to bundle static assets
  • 2
    Webpack-Encore
  • 1
    Better support in Browser Dev-Tools
  • 1
    Redundant

Sign up to add or upvote prosMake informed product decisions

Cons of Babel
Cons of Webpack
    Be the first to leave a con
    • 11
      Hard to configure
    • 2
      Spaghetti-Code out of the box
    • 2
      SystemJS integration is quite lackluster
    • 2
      Loader architecture is quite a mess (unreliable/buggy)
    • 2
      Fire and Forget mentality of Core-Developers
    • 2
      No clear direction

    Sign up to add or upvote consMake informed product decisions

    What is Babel?

    Babel will turn your ES6+ code into ES5 friendly code, so you can start using it right now without waiting for browser support.

    What is Webpack?

    A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows to load parts for the application on demand. Through "loaders" modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.

    Need advice about which tool to choose?Ask the StackShare community!

    Jobs that mention Babel and Webpack as a desired skillset
    What companies use Babel?
    What companies use Webpack?
    See which teams inside your own company are using Babel or Webpack.
    Sign up for Private StackShareLearn More

    Sign up to get full access to all the companiesMake informed product decisions

    What tools integrate with Babel?
    What tools integrate with Webpack?

    Sign up to get full access to all the tool integrationsMake informed product decisions

    Blog Posts

    What are some alternatives to Babel and Webpack?
    TypeScript
    TypeScript is a language for application-scale JavaScript development. It's a typed superset of JavaScript that compiles to plain JavaScript.
    CoffeeScript
    It adds syntactic sugar inspired by Ruby, Python and Haskell in an effort to enhance JavaScript's brevity and readability. Specific additional features include list comprehension and de-structuring assignment.
    ESLint
    A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
    rollup
    It is a module bundler for JavaScript which compiles small pieces of code into something larger and more complex, such as a library or application. It uses the new standardized format for code modules included in the ES6 revision of JavaScript, instead of previous idiosyncratic solutions such as CommonJS and AMD.
    Modernizr
    It’s a collection of superfast tests or detects as we like to call them which run as your web page loads, then you can use the results to tailor the experience to the user. It tells you what HTML, CSS and JavaScript features the user’s browser has to offer.
    See all alternatives
    How developers use Babel and Webpack
    Cloudcraft uses
    Babel

    Babel is awesome! 100% of the code for Cloudcraft.co is transpiled from ES2015 (even some ES7 extensions, like decorators and class properties!), using Gulp+Browserify for the frontend and on-the-fly translation in the Node.js backend. Babel allows us to use all the features of future JS, today, giving us a efficient and clean codebase. Overall, it has been an exceptionally smooth adoption, everything Just Works(tm), including debugging with source maps, etc.

    Volkan Özçelik uses
    Webpack

    Webpack is the best bundler. Period.

    Yes, it has a(n arguably) messy documentation, and a steep learning curve; but once you get the hang of it, there is nothing you cannot do with it.

    Use it and you don’t have to use any other bundler at all.

    It has a vivid ecosystem, and great plugin support.

    Volkan Özçelik uses
    Babel

    When you are using modern (or sometimes experimental) features of the language, you’ll eventually have to transpile them so that your app works in a wide spectrum of user agents.

    Babel is the transpilation tool of my choice.

    Kent Steiner uses
    Babel

    I use babel so I can confidently move forward using ES6 and other more modern Javascript concepts and libraries in development and still maintain compatibility with the current state of web browsers and other viewports.

    Mick Dekkers uses
    Babel

    Babel transpiles ES6/ES2015+ code to a format older browsers (*cough* IE *cough*) can understand. This allows developers to write modern JS code while remaining compatible with older systems.

    Marc3842h uses
    Babel

    Babel is used in Kuro (https://github.com/Marc3842h/kuro).

    Kuro is the browser facing portion of shiro. We use Babel as a easy to use build system for our frontend stack.

    Alec Cunningham uses
    Webpack

    My preferred build tool; allows me to bundle my JSX, JS, CSS files for easy access and I can pass the bundle through my node server for server side rendering.

    Kent Steiner uses
    Webpack

    Flexible building and compiling of source for browser consumption, mainly for JS, but experimenting a little with CSS (although I prefer StylusJS for CSS).

    Andrew Gatenby uses
    Webpack

    We use this to optimise the delivery of the client-side for our revised Admin System, so it's able to be delivered to browsers as efficiently as possible.

    Cameron Drake uses
    Webpack

    Webpack compiles files to bundles with source maps. Using Webpack you can use the latest features (ES6) and have it compiled to compliant js.