forked from tlovett1/simple-cache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
54 lines (47 loc) · 1.13 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
var gulp = require( 'gulp' );
var jshint = require( 'gulp-jshint' );
var sass = require( 'gulp-sass' );
var concat = require( 'gulp-concat' );
var uglify = require( 'gulp-uglify' );
var rename = require( 'gulp-rename' );
var wpPot = require('gulp-wp-pot');
gulp.task(
'lint', function() {
return gulp.src( 'assets/js/src/*.js' )
.pipe( jshint() )
.pipe( jshint.reporter( 'default' ) );
}
);
gulp.task(
'sass', function() {
return gulp.src( 'assets/css/scss/*.scss' )
.pipe( sass() )
.pipe( gulp.dest( 'assets/css' ) );
}
);
gulp.task(
'scripts', function() {
return gulp.src( 'assets/js/src/settings.js' )
.pipe( rename( 'settings.min.js' ) )
.pipe( uglify() )
.pipe( gulp.dest( 'assets/js' ) );
}
);
gulp.task(
'watch', function() {
gulp.watch( 'assets/js/src/*.js', ['lint', 'scripts'] );
gulp.watch( 'assets/css/scss/*.scss', ['sass'] );
}
);
gulp.task(
'makepot',
function () {
return gulp.src(['*.php', 'inc/**/*.php'])
.pipe(wpPot({
domain: 'simple-cache',
package: 'Simple Cache'
}))
.pipe(gulp.dest('languages/simple-cache.pot'));
}
);
gulp.task( 'default', ['lint', 'sass', 'scripts', 'watch'] );