-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
63 lines (54 loc) · 1.54 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
var gulp = require('gulp');
var gutil = require('gulp-util');
var bower = require('bower');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var sh = require('shelljs');
var uglify = require("gulp-uglify");
var paths = {
mainjs: ['./src/**/*.module.js', './src/**/*.js', '!./src/vendors/**/*', '!src/**/*.spec.js', '!src/frameworks.js', '!src/index.js'],
bundlejs: [
'./src/vendors/angular/angular.js',
// put additional external libs here
'./src/vendors/*.module.js'
]
};
function onError(e) {
var err = {
plugin: e.plugin,
message: e.message
};
gutil.log('\n\t### ERROR ###\n' + '\tPlugin: ' + err.plugin + '\n\tMessage: ' + err.message);
this.emit('end');
}
gulp.task('mainjs', function (done) {
gulp.src(paths.mainjs)
.pipe(concat('index.js'))
.on('error', onError)
.pipe(gulp.dest('./src/'))
// .pipe(uglify())
// .on('error', onError)
// .pipe(gulp.dest('./src/'))
.on('end', function () {
done();
});
});
gulp.task('bundlejs', function (done) {
gulp.src(paths.bundlejs)
.pipe(concat('frameworks.js'))
.on('error', onError)
.pipe(gulp.dest('./src/'))
// .pipe(uglify({
// compress: false,
// mangle: false,
// }))
// .pipe(gulp.dest('./src/'))
.on('end', function () {
done();
});
});
gulp.task('watch', function () {
gulp.watch(paths.mainjs, ['mainjs']);
gulp.watch(paths.bundlejs, ['bundlejs']);
});
gulp.task('default', ['watch']);