-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
63 lines (58 loc) · 1.39 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
const { src, dest, series } = require('gulp');
const gulpif = require('gulp-if');
const concat = require('gulp-concat');
const wrap = require('gulp-wrap');
const terser = require('gulp-terser');
const clean = require('gulp-clean');
const rename = require('gulp-rename');
// Input files
const paths = [
'src/tily.js',
'src/utility.js',
'src/extends.js',
'src/vec2.js',
'src/main.js',
'src/transition.js',
'src/buffertransition.js',
'src/offsettransition.js',
'src/scaletransition.js',
'src/bufferbase.js',
'src/buffer.js',
'src/cellbuffer.js',
'src/cell.js',
'src/tilelayer.js',
'src/activetilebase.js',
'src/activetile.js',
'src/activetilelayer.js',
'src/animation.js',
'src/offsetanimation.js',
'src/scaleanimation.js',
'src/foregroundanimation.js',
'src/opacityanimation.js',
'src/rotationanimation.js',
'src/textanimation.js',
'src/outlineanimation.js',
'src/shadowanimation.js'
];
// Output file
const outFile = 'tily.js';
// Cleanup
function clear() {
return src([
'animals.dev.js',
'animals.min.js'
], {
read: false
}).pipe(clean());
}
// Build
function build() {
const dev = process.env.DEV === 'true';
return src(paths)
.pipe(concat(outFile))
.pipe(wrap({ src: 'src/wrapper.js' }))
.pipe(gulpif(!dev, terser()))
.pipe(rename({ extname: dev ? '.dev.js' : '.min.js' }))
.pipe(dest('.'));
}
exports.default = series(build);