当我使用gulp pack我的js文件时,如何解决此错误

时间:2017-02-16 09:40:49

标签: reactjs gulp

events.js:160           扔掉//未处理的'错误'事件           ^     SyntaxError:意外字符' ' https://msdn.microsoft.com/en-us/library/system.datetime(v=vs.110).aspx enter image description here

var gulp = require('gulp');
var browserify = require('browserify');
var babelify = require('babelify');
var shim = require('browserify-shim');
var source = require('vinyl-source-stream');

var uglify = require('gulp-uglify')

gulp.task('script:build', function() {
    browserify('app/main.js')
       .transform(babelify, {
           presets: ['es2015', 'react']
       })
       .transform(shim)
       .bundle()
       .pipe(source('bundle.js').om('error',function (e) {
        console.log(e);
       }))
       .pipe(gulp.dest('./'));

});

gulp.task('default', ['script:build']);

0 个答案:

没有答案