Use babel-polyfill inside phantomjs

Viewed 529

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.

0 Answers
Related