-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
32 lines (27 loc) · 875 Bytes
/
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
// load gulp plugins
var gulp = require('gulp'),
minifyCSS = require('gulp-minify-css'),
rename = require('gulp-rename'),
jshint = require('gulp-jshint'),
imagemin = require('gulp-imagemin');
// define task called css
gulp.task('css', function() {
// grab css file, minify it, save to style.min.css
return gulp.src('public/assets/css/*.css')
.pipe(minifyCSS())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('public/dist/css'));
});
// task for linting js files
gulp.task('js', function() {
return gulp.src(['public/assets/js/*.js', 'public/app/*.js', 'public/app/**/*.js'])
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
// task for minifying images
gulp.task('img', function() {
return gulp.src('public/assets/img/**/*.+(jpg|png|gif|svg)')
.pipe(imagemin())
.pipe(rename({ suffix: '-min' }))
.pipe(gulp.dest('public/dist/img'));
});