-
Notifications
You must be signed in to change notification settings - Fork 19
/
gulpfile.js
43 lines (36 loc) · 1.27 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
var gulp = require('gulp');
var del = require('del');
var zip = require('gulp-zip');
var less = require('gulp-less');
var cssmin = require('gulp-cssmin');
var uglify = require('gulp-uglify');
var autoprefixer = require('gulp-autoprefixer');
var jsonminify = require('gulp-jsonminify');
del.sync('dist');
gulp.task('json', function () {
return gulp.src(['manifest.json'])
.pipe(jsonminify())
.pipe(gulp.dest('dist'));
});
gulp.task('less', function () {
return gulp.src(['css/prism.less', 'css/popup.less'])
.pipe(less())
.pipe(autoprefixer())
.pipe(cssmin())
.pipe(gulp.dest('dist/css'));
});
gulp.task('js', function () {
return gulp.src(['**/*.js', '!node_modules/**', '!js/bugfree.js', '!gulpfile.js'])
.pipe(uglify())
.pipe(gulp.dest('dist'));
});
gulp.task('copy', function () {
return gulp.src(['**/*.woff', '**/*.woff2', '**/*.png', '**/*.svg', '**/*.html', '**/bugfree.js', '**/flat-ui-min.css', '!node_modules/**'])
.pipe(gulp.dest('dist'));
});
gulp.task('build', ['json', 'less', 'js', 'copy'], function () {
return gulp.src('dist/**')
.pipe(zip('archive.zip'))
.pipe(gulp.dest('.'));
});
gulp.task('default', ['build']);