Babel, at its core, does a single thing: convert syntax from one form to another.
Some of Babel's syntax transformations introduce dependencies on ES6 library functionality. It doesn't concern itself with how that functionality got there because:
- The system might already provide it
- The user might only want to load specific pieces of a library
- There are many polyfills and the user might have a specific one it wants to use.
It is the developers job to ensure that the transpiled code is running in an environment where all the functions it needs actually exist.
- Babel should work fine with
es6-shim
if you'd like to keep using it.
Babel also exposes babel/polyfill
as a dead simple way to load a polyfill, which loads core-js
, another polyfill like es6-shim
. Just:
require('babel/polyfill');