forked from jhollingworth/bootstrap-wysihtml5
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgulpfile.js
More file actions
90 lines (77 loc) · 2.39 KB
/
gulpfile.js
File metadata and controls
90 lines (77 loc) · 2.39 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
(function () {
"use strict";
var bump = require("gulp-bump");
var factory = require("widget-tester").gulpTaskFactory;
var fs = require("fs");
var gulp = require("gulp");
var minifyCSS = require("gulp-minify-css");
var path = require("path");
var rename = require("gulp-rename");
var rimraf = require("gulp-rimraf");
var runSequence = require("gulp-run-sequence");
var sourcemaps = require("gulp-sourcemaps");
var uglify = require("gulp-uglify");
var cssFiles = [
"src/css/bootstrap3-wysihtml5-color.css",
"src/css/bootstrap3-wysihtml5-line-height.css",
"src/css/bootstrap3-wysihtml5.css"
];
var angularFiles = [
"src/js/angular/dtv-bootstrap3-wysihtml5.js"
];
var jsFiles = [
"src/js/bootstrap3-wysihtml5.js"
];
gulp.task("bump", function(){
return gulp.src(["./package.json", "./bower.json"])
.pipe(bump({type:"patch"}))
.pipe(gulp.dest("./"));
});
gulp.task("clean", function () {
return gulp.src("dist", { read: false })
.pipe(rimraf());
});
gulp.task("css", function () {
return gulp.src(cssFiles)
.pipe(sourcemaps.init())
.pipe(minifyCSS())
.pipe(rename(function(path) {
path.basename += ".min";
}))
.pipe(sourcemaps.write())
.pipe(gulp.dest("dist/css"));
});
gulp.task("angular", function () {
return gulp.src(angularFiles)
.pipe(sourcemaps.init())
.pipe(uglify())
.pipe(rename(function(path) {
path.basename += ".min";
}))
.pipe(sourcemaps.write())
.pipe(gulp.dest("dist/js/angular"));
});
gulp.task("js", function () {
return gulp.src(jsFiles)
.pipe(sourcemaps.init())
.pipe(uglify())
.pipe(rename(function(path) {
path.basename += ".min";
}))
.pipe(sourcemaps.write())
.pipe(gulp.dest("dist/js"));
});
gulp.task("build", function (cb) {
runSequence(["clean"], ["css", "js", "angular"], cb);
});
gulp.task("webdriver_update", factory.webdriveUpdate());
gulp.task("e2e:server", factory.testServer());
gulp.task("e2e:server-close", factory.testServerClose());
gulp.task("e2e:test-ng", ["webdriver_update"], factory.testE2EAngular({
src: ["test/e2e/angular/*test-ng.js"]
}));
gulp.task("test", function(cb) {
runSequence("build", "e2e:server", "e2e:test-ng", "e2e:server-close", cb);
});
gulp.task("default", ["build"]);
})();