-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
62 lines (51 loc) · 1.34 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
'use strict';
var gulp = require('gulp'),
clean = require('gulp-clean'),
sass = require('gulp-sass'),
livereload = require('gulp-livereload'),
zip = require('gulp-zip'),
manifest = require('gulp-chrome-manifest');
// gulp.task('clean', function (cb) {
// return gulp.src('dist/*', { read: false })
// .pipe(clean());
// // cb();
// });
// gulp.task('copy', function () {
// gulp.src('_locales/**')
// .pipe(gulp.dest('dist/_locales'));
// gulp.src('icons/**')
// .pipe(gulp.dest('icons'));
// return gulp.src('manifest.json')
// .pipe(gulp.dest('dist'));
// });
gulp.task('sass', function () {
gulp.src(['./src/inject/*.scss'])
.pipe(sass({ style: 'expanded' }))
.on('error', sass.logError)
.pipe(gulp.dest('./src/inject'));
});
// gulp.task('version', function () {
//
// });
gulp.task('manifest', function () {
gulp.src('manifest.json')
.pipe(manifest({
buildnumber: true,
background: {
target: 'src/bg/background.html'
}
}))
.pipe(gulp.dest('dist'))
});
gulp.task('build', function (cb) {
cb();
});
gulp.task('package', ['build'], function () {
return gulp.src('dist/**')
.pipe(zip('archive.zip'))
.pipe(gulp.dest('package'));
});
gulp.task('watch', function () {
return gulp.watch('./src/**/*.scss', ['sass']);
});
gulp.task('default', ['sass', 'watch']);