Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

String.prototype.includes not converted to ES5

Tags:

babeljs

ES6's String.prototype.includes function is left as is when compiling to ES5 (CLI babel 5.0.9)

Sorry if this a FAQ, I did search thoroughly.

like image 747
UnluckyPaladin Avatar asked Jul 15 '15 10:07

UnluckyPaladin


1 Answers

Babel converts ES6 syntax into ES5 syntax. It is up to you to load a polyfill so that new ES6 library functions are available. Generally you'd do this with

import 'babel/polyfill';
like image 78
loganfsmyth Avatar answered Nov 05 '22 10:11

loganfsmyth