forked from nakupanda/bootstrap3-dialog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
55 lines (47 loc) · 1.27 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
// Gulpfile.js
"use strict";
var gulp = require("gulp"),
eslint = require("gulp-eslint"),
less = require("gulp-less"),
minifyCSS = require("gulp-minify-css"),
path = require("path"),
notify = require("gulp-notify"),
clean = require("gulp-clean"),
rename = require("gulp-rename"),
uglify = require("gulp-uglify");
gulp.task("less", function() {
gulp.src("src/less/bootstrap-dialog.less")
.pipe(gulp.dest("dist/less"))
.pipe(less({
paths: [path.join(__dirname, "less", "includes")]
}))
.pipe(gulp.dest("dist/css"))
.pipe(gulp.dest("src/css"))
.pipe(rename("bootstrap-dialog.min.css"))
.pipe(minifyCSS())
.pipe(gulp.dest("dist/css"));
});
gulp.task("lint", function() {
gulp.src(["src/js/bootstrap-dialog.js"])
.pipe(eslint())
.pipe(eslint.format());
});
gulp.task("dist", ["clean", "less"], function() {
gulp.src(["src/js/bootstrap-dialog.js"])
.pipe(gulp.dest("dist/js"))
.pipe(rename("bootstrap-dialog.min.js"))
.pipe(uglify())
.pipe(gulp.dest("dist/js"))
.pipe(notify({
message: "Build task completed."
}));
});
gulp.task("clean", function() {
return gulp.src(["dist/"], {
read: false
})
.pipe(clean());
});
gulp.task("default", ["clean"], function() {
gulp.start("dist");
});