-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
39 lines (33 loc) · 990 Bytes
/
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'),
concat = require('gulp-concat');
var sass = require('gulp-sass');
gulp.task('copy', function() {
gulp.src('app/manifest.json')
.pipe(gulp.dest('build'));
gulp.src('app/_locales/**')
.pipe(gulp.dest('build/_locales'));
});
gulp.task('img', function() {
gulp.src('app/icons/*')
.pipe(gulp.dest('build/icons'))
});
gulp.task('js', function() {
gulp.src('app/js/*.js')
.pipe(gulp.dest('build/js'))
});
gulp.task('css', function() {
gulp.src('app/css/*.scss')
.pipe(sass({
outputStyle: 'compressed'
}).on('error', sass.logError))
.pipe(concat('style.css'))
.pipe(gulp.dest('build/css'));
});
gulp.task('watch', function() {
gulp.watch(['app/manifest.json', 'app/_locales/**'], ['copy']);
gulp.watch('app/icons/*', ['img']);
gulp.watch('app/js/*', ['js']);
gulp.watch('app/css/*', ['css']);
})
gulp.task('build', ['copy', 'js', 'css', 'img']);
gulp.task('default', ['copy', 'js', 'css', 'img', 'watch']);