-
Notifications
You must be signed in to change notification settings - Fork 7
/
gulpfile.js
executable file
·48 lines (40 loc) · 1.25 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
// Gulp.
var gulp = require('gulp');
// Sass/CSS stuff.
var exec = require('gulp-exec');
var notify = require("gulp-notify");
// JS stuff.
var minify = require('gulp-minify');
gulp.task('compress', function() {
return gulp.src(['./amd/src/*.js'])
.pipe(minify({
ext: {
min: '.js'
},
noSource: true,
ignoreFiles: []
}))
.pipe(gulp.dest('./amd/build'));
});
gulp.task('purgejs', gulp.series(function() {
return gulp.src('.')
.pipe(exec('php ./../../admin/cli/purge_caches.php --js=true'))
.pipe(notify('Purged JS'));
}));
gulp.task('purgelang', gulp.series(function() {
return gulp.src('.')
.pipe(exec('php ./../../admin/cli/purge_caches.php --lang=true'))
.pipe(notify('Purged Lang'));
}));
gulp.task('purge', gulp.series(function() {
return gulp.src('.')
.pipe(exec('php ./../../admin/cli/purge_caches.php'))
.pipe(notify('Purged All'));
}));
gulp.task('watch', function(done) {
gulp.watch('./amd/src/*.js', gulp.series('compress', 'purgejs'));
gulp.watch(['./lang/**/*.php',], gulp.series('purgelang'));
gulp.watch(['./templates/**/*.mustache', './styles.css'], gulp.series('purge'));
done();
});
gulp.task('default', gulp.series('compress', 'purge', 'watch'));