-
Notifications
You must be signed in to change notification settings - Fork 10
/
gulpfile.js
42 lines (37 loc) · 1.12 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
const {src, dest, series} = require("gulp");
const tsify = require("tsify");
const jsonModify = require('gulp-json-modify');
const vinylSource = require('vinyl-source-stream');
const browserify = require('browserify');
const tar = require('gulp-tar');
const gzip = require('gulp-gzip');
function bundle(){
return browserify({
basedir: ".",
debug: false,
entries: ["app.ts"],
cache: {},
packageCache: {},
})
.plugin(tsify)
.bundle()
.pipe(vinylSource("queueitknownuser.bundle.js"))
.pipe(dest("./dist"));
}
function makePackage() {
return src([
'./dist/queueitknownuser.bundle.js',
])
.pipe(tar('worker.tar'))
.pipe(gzip())
.pipe(dest('./dist'));
}
exports.stripPackage = () => {
return src(['./package.json'])
.pipe(jsonModify({ key: 'devDependencies', value: {}}))
.pipe(jsonModify({ key: 'scripts', value: {}}))
.pipe(dest('./'))
}
exports.buildArtifacts = series(bundle, makePackage);
exports.default = exports.buildArtifacts;
exports.bundle = bundle;