-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
39 lines (34 loc) · 1.08 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
var gulp = require('gulp');
var webpack = require('webpack-stream');
var path = require('path');
var runSequence = require('run-sequence');
//var imagemin = require('gulp-imagemin');
var debug = require('gulp-debug');
var rev = require('gulp-rev');
var del = require('del');
gulp.task('default', function(callback) {
runSequence(
'clean',
'images',
'webpack',
callback);
});
gulp.task('clean', function(callback) {
del('example/dist/**/*', function(){
callback();
});
});
gulp.task('images', function() {
return gulp.src('example/images/**/*.+(jpg|jpeg|ico|png|gif|svg)')
.pipe(debug({title: 'optimizing'}))
//.pipe(imagemin()) // Optimize
.pipe(rev())
.pipe(gulp.dest('example/dist/images'))
.pipe(rev.manifest())
.pipe(gulp.dest('example/dist'));
});
gulp.task('webpack', function() {
return gulp.src(path.join(__dirname, 'example', 'App.jsx'))
.pipe(webpack( require('./webpack.config.js') ))
.pipe(gulp.dest(path.join(__dirname, 'example', 'dist')));
});