-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
39 lines (34 loc) · 1011 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
33
34
35
36
37
38
39
var gulp = require('gulp'),
$ = require('gulp-load-plugins')();
var runSequence = require('run-sequence');
gulp.task('css', function() {
return gulp.src('./client/styles/main.scss')
.pipe($.sass().on('error', $.sass.logError))
.pipe($.cleanCss())
.pipe(gulp.dest('./dist'));
});
gulp.task('css:watch', function() {
gulp.watch('./client/styles/*.scss', ['css']);
});
gulp.task('service-worker', function(callback) {
var swPrecache = require('sw-precache');
swPrecache.write('./dist/service-worker.js', {
staticFileGlobs: [
'dist/*.js',
'dist/*.css',
'dist/*.html'
],
runtimeCaching: [
{
urlPattern: /fonts\.googleapis\.com\//,
handler: 'fastest'
},
{
urlPattern: /fonts\.gstatic\.com\//,
handler: 'fastest'
}
],
navigateFallback: 'dist/index.html',
verbose: true
}, callback);
});