-
Notifications
You must be signed in to change notification settings - Fork 4
/
gulpfile.js
46 lines (40 loc) · 1.37 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
const gulp = require('gulp')
const gulp_zip = require('gulp-zip')
const fs = require('fs')
const del = require('del')
const pconf = require('./package.json')
const conf = {
firefox: {
build: 'build/firefox/',
debug: 'debug/firefox/',
},
chrome: {
build: 'build/chrome/',
debug: 'debug/chrome/',
}
}
// snakk om quick'n'dirty shit
gulp.task('chrome:debug', () => {
gulp.src(['src/chrome/**', 'src/common/**', 'src/manifest.json'])
.pipe(gulp.dest(conf.chrome.debug))
})
gulp.task('chrome:build', () => {
gulp.src(['src/chrome/**', 'src/common/**', 'src/manifest.json'])
.pipe(gulp.dest(conf.chrome.build + 'tmp'))
.pipe(gulp_zip('chrome-' + pconf.version + '.zip'))
.pipe(gulp.dest(conf.chrome.build))
})
gulp.task('firefox:debug', () => {
gulp.src(['src/firefox/**', 'src/common/**', 'src/manifest.json'])
.pipe(gulp.dest(conf.firefox.debug))
})
gulp.task('firefox:build', () => {
gulp.src(['src/firefox/**', 'src/common/**', 'src/manifest.json'])
.pipe(gulp.dest(conf.firefox.build + 'tmp'))
.pipe(gulp_zip('firefox-' + pconf.version + '.zip'))
.pipe(gulp.dest(conf.firefox.build))
})
gulp.task('debug:watch', () => {
gulp.watch('src/**', ['chrome:debug', 'firefox:debug'])
})
gulp.task('default', ['chrome:debug', 'firefox:debug', 'chrome:build', 'firefox:build'])