-
Notifications
You must be signed in to change notification settings - Fork 11
/
gulpfile.js
56 lines (47 loc) · 1.51 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
const gulp = require('gulp');
// Requires the gulp-sass plugin
const sass = require('gulp-sass');
const connect = require('gulp-connect');
const concat = require('gulp-concat');
const watch = require('gulp-watch');
const del = require('del');
const zip = require('gulp-zip');
gulp.task('build', function () {
return gulp.src(['common/js/eliminator-slajdow-common.js'])
.pipe(concat('eliminator-slajdow.js'))
.pipe(gulp.dest('firefox/js/'))
.pipe(gulp.dest('chrome/js/'));
});
gulp.task('chrome', gulp.series('build', () => {
return gulp.src('chrome/**')
.pipe(zip('chrome.zip'))
.pipe(gulp.dest('dist'));
}));
gulp.task('scss', function () {
return gulp.src('common/scss/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('chrome/css'))
.pipe(gulp.dest('firefox/css'))
});
gulp.task('connect', function() {
connect.server({
root: 'build',
livereload: false
});
});
function clean(done) {
// You can use multiple globbing patterns as you would with `gulp.src`
del(['build'], done);
}
gulp.task('clean', clean);
// Rerun the task when a file changes
gulp.task('watch', function () {
gulp.watch('common/js/eliminator-slajdow-common.js', ['build']);
gulp.watch('common/scss/**.scss', ['scss']);
});
// gulp.task('copy-tmp', function () {
// gulp.src('./tmp')
// .pipe(gulp.dest('./public/'));
// });
// The default task (called when you run `gulp` from cli)
gulp.task('default', gulp.series('scss'));