node-es6-demo icon indicating copy to clipboard operation
node-es6-demo copied to clipboard

import babel polyfill

Open cg-lstiburekz opened this issue 10 years ago • 1 comments

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.

cg-lstiburekz avatar Jul 22 '15 20:07 cg-lstiburekz

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.

ds82 avatar Aug 05 '15 11:08 ds82