Is there a way to use ES6 and modules with PhantomJS?
I can transpile each file from ES6 to ES5 using Babel, but it\'s awkward to maintain parallel trees (one in ES6
Browserify's --exclude
option does what I need.
browserify --exclude webpage -t babelify script.js --outfile compiled.js
phantomjs compiled.js
That excludes webpage
from the dependency tree but leaves the import in place.
According to PhantomJS dev's comment on GitHub, the full support of ES6 will come with PhantomJS 2.5.