-
Notifications
You must be signed in to change notification settings - Fork 5
/
Gulpfile.js
47 lines (41 loc) · 1.04 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
var gulp = require('gulp');
var gutil = require('gulp-util');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var jsDir = 'scripts/';
var jsBuild = 'build/';
var jsTarget = '../js';
gulp.task('concat_ugly', function() {
return gulp.src([
jsDir + 'larapush.js',
jsDir + 'connection.js',
jsDir + 'pubsub.js',
])
.pipe(concat('larapush.min.js'))
.pipe(uglify())
.pipe(gulp.dest(jsTarget))
.pipe(gulp.dest(jsBuild));
});
gulp.task('concat_build', function() {
return gulp.src([
jsDir + 'larapush.js',
jsDir + 'connection.js',
jsDir + 'pubsub.js',
])
.pipe(concat('larapush.js'))
.pipe(gulp.dest(jsBuild));
});
gulp.task('concat', function() {
return gulp.src([
jsDir + 'larapush.js',
jsDir + 'connection.js',
jsDir + 'pubsub.js',
])
.pipe(concat('larapush.dev.js'))
.pipe(gulp.dest(jsTarget));
});
gulp.task('default', ['concat', 'watch']);
gulp.task('build', ['concat_ugly', 'concat_build']);
gulp.task('watch', function () {
gulp.watch(jsDir + '/**/*.js', ['concat']);
});