forked from kernox/Mastodon-Share-Browser-Extension
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
60 lines (43 loc) · 1.38 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
var fs = require('fs');
var gulp = require('gulp');
var zip = require('gulp-zip');
var watch = require('gulp-watch');
var preprocess = require('gulp-preprocess');
var pp = require('preprocess');
gulp.task('default',[
'build',
'watch'
]);
gulp.task('watch', function(){
watch(['src/**/*'], {verbose: true})
.pipe(preprocess({context: {ENV: 'chrome'}}))
.pipe(gulp.dest('build/chrome'))
watch(['src/**/*'])
.pipe(preprocess({context: {ENV: 'firefox'}}))
.pipe(gulp.dest('build/firefox'))
});
gulp.task('build', function(){
gulp.src(['src/**/*', '!src/manifest.json', '!src/**/*.png'])
.pipe(preprocess({context: {ENV: 'chrome'}}))
.pipe(gulp.dest('build/chrome'))
gulp.src(['src/**/*', '!src/manifest.json', '!src/**/*.png'])
.pipe(preprocess({context: {ENV: 'firefox'}}))
.pipe(gulp.dest('build/firefox'))
gulp.src(['src/manifest.json'])
.pipe(preprocess({context: {ENV: 'chrome'}, extension: 'js'}))
.pipe(gulp.dest('build/chrome'))
gulp.src(['src/manifest.json'])
.pipe(preprocess({context: {ENV: 'firefox'}, extension: 'js'}))
.pipe(gulp.dest('build/firefox'))
gulp.src(['src/**/*.png'])
.pipe(gulp.dest('build/chrome'))
.pipe(gulp.dest('build/firefox'))
});
gulp.task('pack', function(){
gulp.src('build/firefox/**/*')
.pipe(zip('firefox.zip'))
.pipe(gulp.dest('build'))
gulp.src('build/chrome/**/*')
.pipe(zip('chrome.zip'))
.pipe(gulp.dest('build'))
});