forked from soft-eng-practicum/internapp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
46 lines (38 loc) · 1.11 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
'use strict';
var gulp = require('gulp'),
cleanCSS = require('gulp-clean-css'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
sourcemaps = require('gulp-sourcemaps'),
jshint = require('gulp-jshint'),
stylish = require('jshint-stylish');
var paths = {
css: 'development/css/*.css',
scripts : 'development/javascript/*.js'
};
var dest = {
scripts: 'public/javascript/',
css: 'public/stylesheet/'
};
gulp.task('lint', function() {
return gulp.src('./app/controllers/*.js')
.pipe(jshint())
.pipe(jshint.reporter(stylish))
});
gulp.task('minify-css', function() {
return gulp.src(paths.css)
.pipe(cleanCSS({compatibility: '*'}))
.pipe(concat('styles.css'))
.pipe(gulp.dest(dest.css));
});
gulp.task('scripts', function() {
return gulp.src(paths.scripts)
.pipe(uglify())
.pipe(concat('scripts.min.js'))
.pipe(gulp.dest(dest.scripts))
});
gulp.task('watch', function() {
gulp.watch(paths.css, ['minify-css']);
gulp.watch(paths.scripts, ['scripts']);
});
gulp.task('default', ['minify-css', 'scripts', 'watch']);