forked from kyrofox/iceproject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
54 lines (45 loc) · 1.07 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
var gulp = require('gulp');
var minifyCss = require('gulp-minify-css');
var zip = require('gulp-zip');
var del = require('del');
var uglify = require("gulp-uglify");
var pump = require('pump');
//Where we save the .zip.
var zipFile = 'iceproject.zip';
//Copy over files that need no handling.
gulp.task('assets', function() {
gulp.src(['src/img/**/*', 'src/manifest.json'], {base: 'src'})
.pipe(gulp.dest('dist/'));
});
//Make js files smaller.
gulp.task('js', function(cb) {
pump([
gulp.src('src/js/**/*.js', {base: 'src'}),
uglify(),
gulp.dest('dist/')
],
cb
);
})
//Minify our css.
gulp.task('css', function() {
gulp.src('src/css/**/*', {base: 'src'})
.pipe(minifyCss())
.pipe(gulp.dest('dist/'));
});
//Delte old files.
gulp.task('clean', function() {
return del([
'dist/**/*',
zipFile
]);
});
//Create a zip file.
gulp.task('zip', function() {
gulp.src('dist/**/*')
.pipe(zip(zipFile))
.pipe(gulp.dest('./'));
});
//Default creates the entire distribution.
gulp.task('default', ['assets', 'js', 'css'], function() {
});