forked from GravityPDF/gravity-pdf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
43 lines (38 loc) · 1.19 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
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
cleanCSS = require('gulp-clean-css'),
rename = require('gulp-rename'),
wpPot = require('gulp-wp-pot'),
watch = require('gulp-watch')
/* Minify our CSS */
gulp.task('minify', function () {
return gulp.src('src/assets/css/*.css')
.pipe(cleanCSS({ rebaseTo: 'dist/assets/css/'}))
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('dist/assets/css/'))
})
/* Minify our non-react JS (handled by webpack) */
gulp.task('compress', function () {
return gulp.src('src/assets/js/*.js')
.pipe(uglify())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('dist/assets/js/'))
})
/* Generate the latest language files */
gulp.task('language', function () {
return gulp.src(['src/**/*.php', '*.php'])
.pipe(wpPot({
domain: 'gravity-forms-pdf-extended',
package: 'Gravity PDF'
}))
.pipe(gulp.dest('src/assets/languages/gravity-forms-pdf-extended.pot'))
})
gulp.task('watch', function () {
watch('src/assets/js/*.js', function () { gulp.start('compress') })
watch('src/assets/css/*.css', function () { gulp.start('minify') })
})
gulp.task('default', ['language', 'minify', 'compress'] )