babel vs babel-core vs babel-runtime

Kevin Wu picture Kevin Wu · Sep 13, 2015 · Viewed 19.2k times · Source

My node webpack project uses three babel libraries. What's the difference between these and how are they being used?

"dependencies": {
  "babel-runtime": "^5.8.24"
}

"dev-dependencies": {
  "babel": "^5.8.23",
  "babel-core": "^5.8.23"
}

Answer

JMM picture JMM · Sep 13, 2015

babel-core is the API. For v5 the babel package is the CLI and depends on babel-core. For v6, the babel-cli package is the CLI (the CLI bin command is still babel though) and the babel package doesn't do anything. babel-runtime I guess is just the runtime (polyfill and helpers) to support code that's already been transformed.