-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
51 lines (42 loc) · 1.19 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
"use strict";
const banner = require("gulp-banner");
const del = require("del");
const gulp = require("gulp");
const jshint = require("gulp-jshint");
const pkg = require("./package.json");
const pump = require("pump");
const rename = require("gulp-rename");
const runSequence = require("run-sequence");
const serve = require("gulp-serve");
const uglify = require("gulp-uglify");
gulp.task("default", ["build", "serve", "watch"]);
gulp.task("build", ["js"]);
gulp.task("dist", ["clean"], (callback) => {
runSequence("build", callback);
});
var comment = `/*! ${pkg.name} v${pkg.version} (${pkg.homepage})
* Copyright 2013-${new Date().getFullYear()} eltimn
* @license ${pkg.license}
*/\n`;
gulp.task("js", (callback) => {
pump([
gulp.src("docs/js/jquery.bsFormAlerts.js"),
jshint(".jshintrc"),
jshint.reporter("default"),
jshint.reporter("fail"),
uglify(),
rename({ suffix: ".min" }),
banner(comment, { pkg: pkg }),
gulp.dest("dist/")
], callback);
});
gulp.task("serve", serve({
root: "docs",
port: 8888
}));
gulp.task("clean", () => {
return del(["dist/*"]);
});
gulp.task("watch", function() {
gulp.watch("docs/js/jquery.bsFormAlerts.js", ["build"]);
})