I try to systematize some development works on my project. For this goal I use gulp, and one of stubborn module: gulp-uglify. I have short script:
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']);
But this module is often breaks. Log:
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 «,»
I look for the answer of this problem in issues in github repository, but decision didn't find.
P.S >>> angular-deck.js is created normal.
P.S.S. >>> I think it's not important, but I work on lubuntu 14.04.