-
Notifications
You must be signed in to change notification settings - Fork 7
/
gulpfile.js
60 lines (49 loc) · 1.14 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
const gulp = require('gulp');
const minifycss = require('gulp-minify-css');
const uglify = require('gulp-uglifyjs');
const rename = require('gulp-rename');
const notify = require('gulp-notify');
const babel = require('gulp-babel');
gulp.task('minifycss', function() {
return gulp.src('./src/css/popup.css')
.pipe(minifycss())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('./dist/css'))
.pipe(notify({
message: 'minify css done.'
}));
});
gulp.task('minifyjs', function() {
return gulp.src('./src/js/popup.js')
.pipe(babel({
presets: ['env']
}))
.pipe(uglify())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('./dist/js'))
.pipe(notify({
message: 'minify popupjs done.'
}));
});
gulp.task('minifyContentjs', function() {
excute = gulp.src('./src/content_scripts/ruler.js')
.pipe(babel({
presets: ['env']
}))
.pipe(uglify())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('./dist/content_scripts'))
.pipe(notify({
message: 'minify content_scripts done'
}));
return excute;
});
gulp.task('default', function() {
gulp.start('minifycss', 'minifyjs', 'minifyContentjs');
});