node-es6-demo
node-es6-demo copied to clipboard
import babel polyfill
I'm using this setup to try out various examples in your book. Some of them did not run (e.g. iterating a string using a for-of loop), as the babel polyfill is not included automatically during transpilation.
Adding this in the entry script helped:
import "babel/polyfill"
I know it is not necessary for running this demo, it's just in case someone starts building on it like I did.
The problem with the polyfill is, that it adds about ~145kb to your transpiled script. Even if you just use some of the features/polyfills. I'm currently looking for a way to include only the stuff I actually need.