-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
38 lines (33 loc) · 1.12 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
'use strict';
var
gulp = require('gulp'),
gulpif = require('gulp-if'),
watch = require('gulp-watch'),
sass = require('gulp-sass'),
cleanCSS = require('gulp-clean-css')
;
//
// TASKS
// -------------------------------------------------------------
gulp.task('plugins', function() {
gulp.src('plugins/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(cleanCSS({compatibility: 'ie8'}))
.pipe(gulp.dest('../wp-content/plugins'));
gulp.src(['plugins/**/*', '!plugins/**/*.scss', '!plugins/**/.anchor'])
.pipe(gulp.dest('../wp-content/plugins'));
})
gulp.task('themes', function() {
gulp.src('themes/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(cleanCSS({compatibility: 'ie8'}))
.pipe(gulp.dest('../wp-content/themes'));
gulp.src(['themes/**/*', '!themes/**/*.scss', '!themes/**/.anchor'])
.pipe(gulp.dest('../wp-content/themes'));
})
gulp.task('watch-only', function() {
gulp.watch('plugins/**/*', ['plugins']);
gulp.watch('themes/**/*', ['themes']);
});
gulp.task('watch', ['plugins', 'themes', 'watch-only'])
gulp.task('default', ['plugins', 'themes'])