-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGulpfile.js
40 lines (35 loc) · 1.18 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
var gulp = require('gulp');
var sass = require('gulp-sass');
var connect = require('gulp-connect');
// Compile CSS files and output for distribution and the library
gulp.task('styles', function() {
gulp.src(['./sass/webhopper.scss'])
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('dist/'))
.pipe(gulp.dest('library/app/css/'))
gulp.src(['./sass/adapters.scss'])
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('library/app/css/'))
});
// Setup the development server with live reloading
gulp.task('connect', function() {
connect.server({
root: 'library',
port: 7000,
livereload: true
});
});
// Force a refresh of the development server
gulp.task('reload', function () {
gulp.src('./app/*.html')
.pipe(connect.reload());
});
// Automatically monitor, compile, and refresh any changes
gulp.task('watch', function() {
// Watch SASS directory and auto compile changes
gulp.watch('./sass/**/*.scss', ['styles'])
// Watch library directory for changes to source
gulp.watch('./library/**/*.*', ['reload']);
});
// Default task to perform all of the above when gulp cmd is issued
gulp.task('default', ['styles', 'connect', 'watch']);