forked from 18F/18f.gsa.gov
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
44 lines (37 loc) · 1.1 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
var gulp = require('gulp'),
minifycss = require('gulp-minify-css'),
uglify = require('gulp-uglify'),
clean = require('gulp-clean'),
concat = require('gulp-concat');
var scripts = ['js/jquery-dotdotdot/src/js/jquery.dotdotdot.js', 'js/bootstrap-3.1.1.js', 'js/slideshow.js', 'js/18f.js', 'js/federated-analytics.js'];
var styles = ['styles/fonts.css', 'styles/18f.css'];
// CSS
gulp.task('styles', function() {
return gulp.src(styles)
.pipe(concat('18f.min.css'))
.pipe(minifycss())
.pipe(gulp.dest('styles'));
});
// Scripts
gulp.task('scripts', function() {
return gulp.src(scripts)
.pipe(concat('18f.min.js'))
.pipe(uglify())
.pipe(gulp.dest('js'));
});
// Clean
gulp.task('clean', function() {
return gulp.src(['styles/18f.min.css', 'js/18f.min.js'], {read: false})
.pipe(clean());
});
// Default task
gulp.task('default', ['clean'], function() {
gulp.start('styles', 'scripts');
});
// Watch
gulp.task('watch', function() {
// Watch .css files
gulp.watch(styles, ['styles']);
// Watch .js files
gulp.watch(scripts, ['scripts']);
});