Files: 1bfb0d193cbe211d8658796595d6f4020592add5 / gulpfile.js
721 bytesRaw
1 | const gulp = require('gulp'); |
2 | const minifyHtml = require('gulp-minify-html'); |
3 | const cleanCSS = require('gulp-clean-css'); |
4 | const usemin = require('gulp-usemin'); |
5 | const uglify = require('gulp-uglify'); |
6 | const rev = require('gulp-rev'); |
7 | |
8 | gulp.task('copy', () => |
9 | gulp.src(['src/favicon.png']) |
10 | .pipe(gulp.dest('dist/'))); |
11 | |
12 | gulp.task('sw', () => |
13 | gulp.src(['src/service-worker.js']) |
14 | .pipe(uglify()) |
15 | .pipe(gulp.dest('dist/'))); |
16 | |
17 | gulp.task('build', ['copy', 'sw'], function () { |
18 | return gulp.src('src/index.html') |
19 | .pipe(usemin({ |
20 | css: [ rev() ], |
21 | js: [ uglify(), rev() ], |
22 | html: [ minifyHtml({ empty: true }) ], |
23 | inlinecss: [ cleanCSS, 'concat' ] |
24 | })) |
25 | .pipe(gulp.dest('dist/')); |
26 | }); |
27 |
Built with git-ssb-web