-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
executable file
·72 lines (62 loc) · 2.05 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
64
65
66
67
68
69
70
71
72
var gulp = require('gulp');
gulp.task('default', function() {
console.log('Use the following commands');
console.log('--------------------------');
console.log('gulp compile-css to compile the custom.scss to custom.css');
console.log('gulp compile-js to compile the custom.js to custom.min.js');
console.log('gulp watch to continue watching the files for changes.');
console.log('gulp wordpress-lang to compile the africatvl-child.pot, en_EN.po and en_EN.mo');
});
var sass = require('gulp-sass');
var jshint = require('gulp-jshint');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var sort = require('gulp-sort');
var wppot = require('gulp-wp-pot');
var gettext = require('gulp-gettext');
gulp.task('sass', function() {
gulp.src('assets/css/custom.scss')
.pipe(sass())
.pipe(gulp.dest('assets/css'));
});
gulp.task('js', function() {
gulp.src('assets/js/custom.js')
.pipe(jshint())
.pipe(jshint.reporter('fail'))
.pipe(concat('custom.min.js'))
.pipe(uglify())
.pipe(gulp.dest('assets/js'));
});
gulp.task('compile-css', ['sass']);
gulp.task('compile-js', ['js']);
gulp.task('watch', function() {
gulp.watch('assets/css/***/***', ['sass']);
gulp.watch('assets/css/***', ['sass']);
gulp.watch('assets/js/custom.js', ['js']);
});
gulp.task('wordpress-pot', function() {
return gulp.src('**/*.php')
.pipe(sort())
.pipe(wppot({
domain: 'tour-operator-lsx-child',
package: 'tour-operator-lsx-child',
team: 'LightSpeed <[email protected]>'
}))
.pipe(gulp.dest('languages/tour-operator-lsx-child.pot'));
});
gulp.task('wordpress-po', function() {
return gulp.src('**/*.php')
.pipe(sort())
.pipe(wppot({
domain: 'tour-operator-lsx-child',
package: 'tour-operator-lsx-child',
team: 'LightSpeed <[email protected]>'
}))
.pipe(gulp.dest('languages/en_EN.po'));
});
gulp.task('wordpress-po-mo', ['wordpress-po'], function() {
return gulp.src('languages/en_EN.po')
.pipe(gettext())
.pipe(gulp.dest('languages'));
});
gulp.task('wordpress-lang', (['wordpress-pot', 'wordpress-po-mo']));