forked from protobufjs/protobuf.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
74 lines (60 loc) · 1.89 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
67
68
69
70
71
72
73
74
var gulp = require("gulp");
var bundle = require("./scripts/bundle");
gulp.task("default", [
"bundle-development", "bundle-production", "gzip-production",
"bundle-development-runtime", "bundle-production-runtime", "gzip-production-runtime",
"bundle-development-noparse", "bundle-production-noparse", "gzip-production-noparse"
]);
// Full build
gulp.task("bundle-development", bundle.bind(this, {
entry : "./src",
target : "./dist"
}));
gulp.task("bundle-production" , bundle.bind(this, {
entry : "./src",
target : "./dist",
compress : true
}));
gulp.task("gzip-production", [ "bundle-production" ], function(callback) {
bundle.compress(
"./dist/protobuf.min.js",
"./dist/protobuf.min.js.gz",
callback
);
});
// Minimal runtime
gulp.task("bundle-development-runtime", bundle.bind(this, {
entry : "./runtime",
target : "./dist/runtime"
}));
gulp.task("bundle-production-runtime" , bundle.bind(this, {
entry : "./runtime",
target : "./dist/runtime",
compress : true
}));
gulp.task("gzip-production-runtime", [ "bundle-production-runtime" ], function(callback) {
bundle.compress(
"./dist/runtime/protobuf.min.js",
"./dist/runtime/protobuf.min.js.gz",
callback
);
});
// Noparse build
gulp.task("bundle-development-noparse", bundle.bind(this, {
entry : "./src",
target : "./dist/noparse",
exclude : [ "./tokenize", "./parse", "./common" ]
}));
gulp.task("bundle-production-noparse" , bundle.bind(this, {
entry : "./src",
target : "./dist/noparse",
exclude : [ "./tokenize", "./parse", "./common" ],
compress : true
}));
gulp.task("gzip-production-noparse", [ "bundle-production-noparse" ], function(callback) {
bundle.compress(
"./dist/noparse/protobuf.min.js",
"./dist/noparse/protobuf.min.js.gz",
callback
);
});