forked from toncenter/ton-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
66 lines (57 loc) · 1.78 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
61
62
63
64
65
66
var gulp = require('gulp'),
cssmin = require('gulp-cssmin'),
del = require('del'),
deleteLines = require('gulp-delete-lines'),
concatCss = require('gulp-concat-css');
var rename = require('gulp-rename');
var replace = require('gulp-replace');
gulp.task('clean', function () {
return del(['build']);
});
gulp.task('clean-firefox', function () {
return del(['build-firefox']);
});
gulp.task('copy', function () {
return gulp.src([
'src/assets/**',
'src/libs/**',
'src/**/*.html'
], {base: 'src'})
.pipe(gulp.dest('build'))
.pipe(gulp.dest('build-firefox'));
});
gulp.task('copy-chrome', function () {
return gulp.src([
'src/js/extension/*',
'src/manifest.json'
], {base: 'src'})
.pipe(gulp.dest('build'));
});
gulp.task('copy-firefox', function () {
return gulp.src([
'src/firefox/contentscript.js',
'src/firefox/manifest.json',
], {base: 'src/firefox'})
.pipe(gulp.dest('build-firefox/'));
});
gulp.task('minify-css', function () {
return gulp.src('src/css/**/*.css')
.pipe(concatCss('main.css'))
.pipe(cssmin())
.pipe(gulp.dest('build/css'))
.pipe(gulp.dest('build-firefox/css'));
});
gulp.task('popup-html', function () {
return gulp.src('src/index.html')
.pipe(replace('<body>', '<body class="plugin">'))
.pipe(deleteLines({
'filters': [
/Controller.js/i
]
}))
.pipe(rename('popup.html'))
.pipe(gulp.dest('build'))
.pipe(gulp.dest('build-firefox'));
});
gulp.task('build', gulp.series('clean', 'clean-firefox', 'copy', 'copy-chrome', 'copy-firefox', 'minify-css', 'popup-html'));
gulp.task('default', gulp.series('clean', 'clean-firefox', 'build'));