Gulp uglify不起作用

时间:2014-10-14 18:16:36

标签: javascript ubuntu gulp gulp-uglify

我尝试将一些开发工作系统化到我的项目中。为了这个目标,我使用gulp和一个顽固的模块:gulp-uglify。我有简短的剧本:

var gulp = require('gulp'),
    gp_concat = require('gulp-concat'),
    gp_rename = require('gulp-rename'),
    gp_uglify = require('gulp-uglify');

gulp.task('source', function () {
    gulp.src(['source/src/module.js', 'source/src/**/*.js'])
        .pipe(gp_concat('angular-deck.js'))
        .pipe(gulp.dest('source/dist/'))
        .pipe(gp_rename('angular-deck.min.js'))
        .pipe(gp_uglify().on('error', function(e) { console.log('\x07',e.message); return this.end(); }))
        .pipe(gulp.dest('source/dist/'));
});

gulp.task('watch', function () {
    gulp.watch('source/src/**/*.js', ['source']);
});

gulp.task('default', ['source', 'watch']);

但是这个模块经常会中断。经度:

old@old:~/Desktop/PROJECTS/angular-deck$ gulp
[22:03:44] Using gulpfile ~/Desktop/PROJECTS/angular-deck/gulpfile.js
[22:03:44] Starting 'source'...
[22:03:44] Finished 'source' after 13 ms
[22:03:44] Starting 'watch'...
[22:03:44] Finished 'watch' after 11 ms
[22:03:44] Starting 'default'...
[22:03:44] Finished 'default' after 10 μs
 Unexpected token name «type», expected punc «,»
[22:03:58] Starting 'source'...
[22:03:58] Finished 'source' after 2.78 ms
 Unexpected token name «type», expected punc «,»
[22:04:02] Starting 'source'...
[22:04:02] Finished 'source' after 2.35 ms
 Unexpected token name «type», expected punc «,»

我在github存储库中的问题中寻找这个问题的答案,但是没有找到决定。

P.S>>> angular-deck.js是正常的。

P.S.S。 >>>我认为这不重要,但我在lubuntu 14.04上工作。

0 个答案:

没有答案