-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
executable file
·50 lines (44 loc) · 1.5 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
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var sort = require('gulp-sort');
var wppot = require('gulp-wp-pot');
gulp.task('default', function() {
console.log('Use the following commands');
console.log('--------------------------');
console.log('gulp js to compile the to-vehicles.js to to-vehicles.min.js');
console.log('gulp compile-js to compile both JS files above');
console.log('gulp watch to continue watching all files for changes, and build when changed');
console.log('gulp wordpress-pot to compile the lsx-mega-menus.pot');
console.log('gulp reload-node-js Copy over the .js files from teh various node modules');
});
gulp.task('js', function (done) {
return gulp.src('assets/js/to-vehicles.js')
.pipe(concat('to-vehicles.min.js'))
.pipe(uglify())
.pipe(gulp.dest('assets/js')),
done();
});
gulp.task('compile-js', gulp.series( ['js'] , function(done) {
done();
}));
gulp.task('watch-js', function (done) {
done();
return gulp.watch('assets/js/to-vehicles.js', gulp.series('compile-js'));
});
gulp.task('watch', gulp.series( ['watch-js'] , function(done) {
done();
}));
gulp.task('wordpress-pot', function (done) {
return gulp.src('**/*.php')
.pipe(sort())
.pipe(wppot({
domain: 'to-vehicles',
destFile: 'to-vehicles.pot',
package: 'to-vehicles',
bugReport: 'https://www.lsdev.biz/product/tour-operator-vehicles/issues',
team: 'LightSpeed <[email protected]>'
}))
.pipe(gulp.dest('languages')),
done();
});