forked from idxbroker/wordpress-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
executable file
·58 lines (46 loc) · 1.55 KB
/
gulpfile.js
File metadata and controls
executable file
·58 lines (46 loc) · 1.55 KB
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
'use strict';
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
stylish = require('jshint-stylish'),
rename = require('gulp-rename'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
notify = require('gulp-notify'),
sourcemaps = require('gulp-sourcemaps'),
glob = require('glob'),
gutil = require('gulp-util');
/*
gulp.task('jshint', function(){
return gulp.src('./assets/src/js/*.js')
.pipe ( jshint( ) )
.pipe ( jshint.reporter( stylish ) )
.pipe ( jshint.reporter( 'fail' ) );
})
*/
gulp.task('js', function() {
glob('./assets/src/js/*.js', function(err, files) {
if (err) done(err);
var tasks = files.map(function(entry) {
return gulp.src(entry)
.pipe(uglify().on('error', gutil.log))
.pipe(rename(function (path) {
path.extname = '.min.js';
}))
.pipe(gulp.dest('./assets/js/'))
.pipe(notify({message: 'Finished minifying ' + entry }));
})
})
})
gulp.task('css', function() {
//concat CSS and put them in appropriate space
// will implement once we implement Sass
console.log('css task not implemented yet');
})
gulp.task('readme', function() {
//convert readme.txt to readme.md
console.log('readme conversion not yet implemented');
})
gulp.task('watch', function() {
gulp.watch('./assets/src/js/*.js', ['js']);
})
gulp.task('default', ['js'], function() {});