-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
72 lines (62 loc) · 2.04 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
var gulp = require("gulp"),
header = require("gulp-header"),
concat = require("gulp-concat"),
uglify = require("gulp-uglify"),
zip = require("gulp-zip"),
pkg = require("./package.json");
var d = new Date();
var releaseDate = d.getDate() + "-" + (d.getMonth() + 1) + "-" + d.getFullYear()
var fullStack = [
"node_modules/stik-core/dist/stik-core.js",
"node_modules/stik-courier/dist/stik-courier.js",
"node_modules/stik-helpers/dist/stik-helpers.js",
"node_modules/stik-view-bag/dist/stik-view-bag.js",
"node_modules/stik-url/dist/stik-url.js",
"node_modules/stik-labs/dist/stik-labs.js"
];
var lightStack = [
"node_modules/stik-core/dist/stik-core.js",
];
var banner = [
"<%= pkg.banner.divider %>",
"<%= pkg.banner.project %>",
"<%= pkg.banner.copyright %>",
"<%= pkg.banner.license %>",
"<%= pkg.banner.licenseLink %>",
"<%= pkg.banner.divider %>",
"\n// Version: <%= pkg.version %> | From: <%= date %>\n",
""].join("\n");
gulp.task("pack", function(){
// full featured versions
gulp.src(fullStack)
.pipe(concat("stik.js"))
.pipe(header(banner, { pkg: pkg, date: releaseDate }))
.pipe(gulp.dest("dist"))
.pipe(concat("stik.min.js"))
.pipe(uglify())
.pipe(gulp.dest("dist"));
// light weight versions
gulp.src(lightStack)
.pipe(concat("stik-light.js"))
.pipe(header(banner, { pkg: pkg, date: releaseDate }))
.pipe(gulp.dest("dist"))
.pipe(concat("stik-light.min.js"))
.pipe(uglify())
.pipe(gulp.dest("dist"));
// light zipped version
gulp.src("dist/stik-light.js")
.pipe(zip("stik-light.js.zip"))
.pipe(gulp.dest("dist"));
// light minified zipped version
gulp.src("dist/stik-light.min.js")
.pipe(zip("stik-light.min.js.zip"))
.pipe(gulp.dest("dist"));
// normal zipped version
gulp.src("dist/stik.js")
.pipe(zip("stik.js.zip"))
.pipe(gulp.dest("dist"));
// normal minified zipped version
gulp.src("dist/stik.min.js")
.pipe(zip("stik.min.js.zip"))
.pipe(gulp.dest("dist"));
});