3

How can i use babel-polyfill inside phantomjs to get some es6 futures?

I have phantomjs 2.1.1, and babel-polyfill installed (via npm install babel-polyfill).

Here is file main.js:

require('babel-polyfill');
console.log(String.startsWith);

When i run phantomjs main.js it prints undefined to console, however babel-polyfill should add String.startsWith method.

diralik
  • 6,391
  • 3
  • 28
  • 52

0 Answers0