-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
60 lines (52 loc) · 1.3 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
'use strict';
var gulp = require('gulp');
var plugins = require('gulp-load-plugins')();
var minify = require('gulp-minify');
var scripts = {
name: 'mosaic.js',
min: 'mosaic.min.js',
main: 'dist/mosaic.js',
src: 'js/*.js',
list: [
'js/utils.js',
'js/core.js',
'js/mosaicCollection.js',
'js/pool.js',
'js/imagePainter.js',
'js/client.js'
],
all:[
'js/core.js',
'js/pool.js',
'js/imagePainter.js',
'js/mosaicCollection.js',
'js/client.js',
'js/average.js',
'js/columnLoader.js',
'js/getRowAverage.js',
'js/httprequest.js',
'js/imageRemoteLoad.js',
'js/mosaic.js',
'js/utils.js'
],
dest: 'dist',
};
gulp.task('compress', ['js+'], function() {
gulp.src(scripts.main)
.pipe(minify())
.pipe(gulp.dest('dist'));
});
gulp.task('js+', function () {
return gulp.src(scripts.list)
.pipe(plugins.concat(scripts.name))
.pipe(gulp.dest(scripts.dest));
});
gulp.task('jshint', ['js+'], function () {
return gulp.src(scripts.all)
.pipe(plugins.jshint())
.pipe(plugins.jshint.reporter('default'));
});
gulp.task('watch', function () {
gulp.watch(scripts.list, ['compress']);
});
gulp.task('default', ['watch']);