forked from marklieberman/foxygestures
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
56 lines (49 loc) · 1.23 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
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
jsonlint = require("gulp-jsonlint");
sass = require('gulp-sass'),
zip = require('gulp-zip');
var sources = {
js: [
'src/**/*.js',
'!**/lib/**'
],
json: [
'src/_locales/**/*.json'
],
sass: [
'src/options/options.scss'
],
dist: [
'src/**',
'!**/*.scss'
]
};
gulp.task('default', [ 'lint', 'jsonlint', 'sass', 'watch' ]);
gulp.task('watch', [ 'sass' ], function () {
gulp.watch(sources.js, [ 'lint' ]);
gulp.watch(sources.json, [ 'jsonlint' ]);
gulp.watch(sources.sass, [ 'sass' ]);
});
gulp.task('sass', function () {
gulp.src(sources.sass)
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('src/options/'));
});
gulp.task('lint', function () {
return gulp.src(sources.js)
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('jsonlint', function () {
return gulp.src(sources.json)
.pipe(jsonlint())
.pipe(jsonlint.reporter());
});
gulp.task('dist', [ 'sass' ], function () {
return gulp.src(sources.dist)
.pipe(zip('foxygestures.xpi', {
compress: false
}))
.pipe(gulp.dest('dist'));
});