forked from foundation/foundation-libsass-template
-
Notifications
You must be signed in to change notification settings - Fork 7
/
gulpfile.js
61 lines (47 loc) · 1.34 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
// Include gulp
var gulp = require('gulp');
// Include Our Plugins
// Load plugins
var $ = require('gulp-load-plugins')({camelize: true});
gulp.task('lint', function() {
gulp.src('./js/*.js')
.pipe($.jshint())
.pipe($.jshint.reporter('default'));
});
gulp.task('sass', function() {
gulp.src('./scss/*.scss')
.pipe($.sass({includePaths: ['bower_components/foundation/scss']}))
.pipe(gulp.dest('./css'))
.pipe($.connect.reload());
});
// Concatenate & Minify JS
gulp.task('scripts', function() {
gulp.src('./js/*.js')
.pipe($.concat('all.js'))
// .pipe(gulp.dest('./dist'))
// .pipe($.rename('all.min.js'))
// .pipe($.uglify())
// .pipe(gulp.dest('./dist'))
.pipe($.connect.reload());
});
// Connect Server
gulp.task('connect', $.connect.server({
root: __dirname,
port: 9000,
livereload: true
}));
// Watch
gulp.task('watch', ['connect', 'lint', 'sass', 'scripts'], function () {
// Watch for changes in `app` folder
gulp.watch([
'./*.html',
'./scss/**/*.scss',
'./js/**/*.js'
], $.connect.reload);
// Watch .scss files
gulp.watch('./scss/*.scss', ['sass']);
// Watch .js files
gulp.watch('./js/*.js', ['lint', 'scripts']);
});
// Default Task
gulp.task('default', ['lint', 'sass', 'scripts']);