0

ここでPhantomJS newbはカルマとPhantomJSを使って、Jenkinsでブラウザテストを実行できるようにしようとしています。PhantomJSでJSランタイムをサポート

ので、同じよう聞かせて変数宣言を使用しているとき、私はPhantomJS

PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR 
    SyntaxError: Expected an identifier but found 'handlePageRequest' instead 
    at public/app.js:45 

と、この明白なエラーが出る:

let handlePageRequest = {}; 

がどのように私はクロームまたはMozillaうの最新バージョンのようなJavaScriptを解釈するためにPhantomJSを伝えることができます?

答えて

0

バベルと私たちのコードを最適化して蒸解したところ、うまくいきました。

これは私がtranspileおよび最適化するために使用するものである:

gulp.task('bundle-prod', ['clean'], function (cb) { 

     // this takes all the js files in public dir, except for those in public/lib 
     // minifies them 
     // concatenates them 
     // then writes the concatenated file to app-production.js 
     // so in production, all our angular.js javascript code is in one file 

     pump([ 
      gulp.src(['public/**/*.js','!public/lib/**/*'], {}), 
      babel({ 
      ignore: ['public/lib/**/*'], 
      comments: false, 
      minified: true, 
      plugins: ['transform-remove-console'], 
      presets: ['env'] 
      }), 
      concat('public/dist/app-production.js'), 
      gulp.dest('.') 
     ], 
     cb 
    ); 

}); 
関連する問題