forked from methodofaction/Method-Draw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
75 lines (64 loc) · 1.72 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
const gulp = require('gulp');
const concat = require('gulp-concat');
const useref = require('gulp-useref');
const replace = require('gulp-replace');
const cachebust = require('gulp-cache-bust');
const minify = require('gulp-minify');
gulp.task('css', function () {
return gulp.src('src/css/*.css')
.pipe(concat('all.css'))
.pipe(gulp.dest('dist'));
});
gulp.task('js', function () {
return gulp.src(['src/js/*.js', 'src/lib/*.js'])
.pipe(concat('all.js'))
.pipe(gulp.dest('dist'));
});
gulp.task('loading', function () {
return gulp.src('src/js/loading.js')
.pipe(gulp.dest('dist'));
});
gulp.task('index', function () {
return gulp.src('src/*.html')
.pipe(useref())
.pipe(cachebust({type: 'timestamp'}))
.pipe(gulp.dest('dist'));
});
// no service worker implemented yet
gulp.task('cache', function(){
return gulp.src(['./src/serviceworker.js'])
.pipe(replace('<timestamp>', Date.now()))
.pipe(gulp.dest('./dist/'));
});
gulp.task('manifest', function(){
return gulp.src(['./src/site.webmanifest'])
.pipe(gulp.dest('./dist/'));
});
gulp.task('images', function(){
return gulp.src(['src/images/**/*'])
.pipe(gulp.dest('dist/images'));
});
gulp.task('extensions', function(){
return gulp.src(['src/extensions/**/*'])
.pipe(gulp.dest('dist/extensions'));
});
gulp.task('shapelib', function(){
return gulp.src(['src/shapelib/**/*'])
.pipe(gulp.dest('dist/shapelib'));
});
gulp.task('canvg', function(){
return gulp.src(['src/js/lib/canvg.js', 'src/js/lib/rgbcolor.js'])
.pipe(gulp.dest('dist/js/lib'));
});
gulp.task('build',
gulp.series(
'css',
'js',
'index',
'manifest',
'images',
'extensions',
'shapelib',
'canvg'
)
);