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"
}
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"
}
The Six Things You Need To Know About Babel 6 explained it quite well, to quote
TL;DR The things to compare here are:
From https://babeljs.io/blog/2015/10/31/setting-up-babel-6:
babel-runtime just allows polyfills that don't pollute the global space, unlike babel-polyfill which pollutes your global space. From http://babeljs.io/docs/plugins/transform-runtime/:
If you use babel-runtime, you should also
npm install --save-dev babel-plugin-transform-runtime
Also, babel-runtime+babel-plugin-transform-runtime and babel-polyfill are generally mutually exclusive--meaning you should only use one or the other. From a comment here http://jamesknelson.com/the-six-things-you-need-to-know-about-babel-6/:
babel-core
is the API. For v5 thebabel
package is the CLI and depends onbabel-core
. For v6, thebabel-cli
package is the CLI (the CLI bin command is stillbabel
though) and thebabel
package doesn't do anything.babel-runtime
I guess is just the runtime (polyfill and helpers) to support code that's already been transformed.