forked from kylephillips/wp-nested-pages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
73 lines (66 loc) · 1.93 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
73
var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefix = require('gulp-autoprefixer');
var livereload = require('gulp-livereload');
var notify = require('gulp-notify');
var plumber = require('gulp-plumber');
var jshint = require('gulp-jshint');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
// Paths
var scss = 'assets/scss/**/*';
var css = 'assets/css/';
var js_source = [
'assets/js/lib/nestedpages-responsive.js',
'assets/js/lib/nestedpages.formatter.js',
'assets/js/lib/nestedpages.menu-toggle.js',
'assets/js/lib/nestedpages.page-toggle.js',
'assets/js/lib/nestedpages.nesting.js',
'assets/js/lib/nestedpages.sync-menu-setting.js',
'assets/js/lib/nestedpages.new-page.js',
'assets/js/lib/nestedpages.quickedit-post.js',
'assets/js/lib/nestedpages.quickedit-link.js',
'assets/js/lib/nestedpages.clone.js',
'assets/js/lib/nestedpages.tabs.js',
'assets/js/lib/nestedpages-factory.js',
'assets/js/lib/nestedpages.menu-links.js',
'assets/js/lib/nestedpages.menu-search.js',
'assets/js/lib/nestedpages.trash.js',
'assets/js/lib/nestedpages.confirm-delete.js'
];
var js_compiled = 'assets/js/';
/**
* Smush the admin Styles and output
*/
gulp.task('scss', function(){
return gulp.src(scss)
.pipe(sass({ outputStyle: 'compressed' }))
.pipe(autoprefix('last 15 version'))
.pipe(gulp.dest(css))
.pipe(plumber())
.pipe(livereload())
.pipe(notify('Nested Pages styles compiled & compressed.'));
});
/**
* Smush the JS and output
*/
gulp.task('scripts', function(){
return gulp.src(js_source)
.pipe(concat('nestedpages.min.js'))
.pipe(gulp.dest(js_compiled))
.pipe(uglify())
.pipe(gulp.dest(js_compiled))
.pipe(notify('Nested Pages scripts compiles & compressed.'));
});
/**
* Watch Task
*/
gulp.task('watch', function(){
livereload.listen(35829);
gulp.watch(scss, ['scss']);
gulp.watch(js_source, ['scripts']);
});
/**
* Default
*/
gulp.task('default', ['scss', 'scripts', 'watch']);