-
Notifications
You must be signed in to change notification settings - Fork 13
/
gulpfile.js
38 lines (33 loc) · 1.09 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
var gulp = require('gulp');
var fse = require('fs-extra');
var jshint = require('gulp-jshint');
var oghliner = require('oghliner');
gulp.task('clean', function() {
fse.removeSync('dist');
fse.mkdirSync('dist');
});
var ignore = ['!./dist/**', '!./node_modules/**', '!./coverage/**'];
gulp.task('lint', function() {
return gulp.src(['**/*.js'].concat(ignore))
.pipe(jshint({esnext: true}))
.pipe(jshint.reporter('default', {esnext: true}));
});
gulp.task('build', function() {
return gulp
.src([
'static/*',
// localForage
'node_modules/localforage/dist/localforage.min.js',
// QuaggaJS
'node_modules/quagga/dist/quagga.min.js',
// bwip-js
'node_modules/bwip-js/bwip.js', 'node_modules/bwip-js/bwipp/code128.js', 'node_modules/bwip-js/bwipp/raiseerror.js', 'node_modules/bwip-js/bwipp/renlinear.js', 'node_modules/bwip-js/freetype.js', 'node_modules/bwip-js/freetype.js.mem',
])
.pipe(gulp.dest('dist'));
});
gulp.task('default', ['clean', 'lint', 'build'], function() {
return oghliner.offline({
rootDir: 'dist/',
importScripts: ['sw-push.js'],
});
});