forked from protobufjs/protobuf.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
30 lines (26 loc) · 949 Bytes
/
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
var gulp = require("gulp"),
bundle = require("./scripts/bundle");
var defaultTask = [];
function defineTask(name, entry, target) {
gulp.task(name + "-bundle", bundle.bind(this, {
entry : entry,
target : target
}));
gulp.task(name + "-minify" , [ name + "-bundle" ], bundle.bind(this, {
entry : entry,
target : target,
compress : true
}));
gulp.task(name + "-compress", [ name + "-minify" ], function(callback) {
bundle.compress(
target + "/protobuf.min.js",
target + "/protobuf.min.js.gz",
callback
);
});
defaultTask.push(name + "-bundle", name + "-minify", name + "-compress");
}
defineTask("full" , "./src/index" , "./dist" );
defineTask("light" , "./src/index-light" , "./dist/light" );
defineTask("minimal", "./src/index-minimal", "./dist/minimal");
gulp.task("default", defaultTask);