forked from EugenMayer/bootstrap-dialog
-
Notifications
You must be signed in to change notification settings - Fork 31
/
gulpfile.js
68 lines (56 loc) · 1.76 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
// Gulpfile.js
"use strict";
const fs = require('fs');
var gulp = require("gulp"),
sass = require("gulp-sass")(require('node-sass')),
minifyCSS = require("gulp-minify-css"),
notify = require("gulp-notify"),
clean = require("gulp-clean"),
rename = require("gulp-rename"),
uglify = require("gulp-uglify");
gulp.task("sass", function (cb) {
gulp.src("src/scss/bootstrap-dialog.scss")
.pipe(sass())
.pipe(gulp.dest("dist/css"))
.pipe(rename("bootstrap-dialog.min.css"))
.pipe(minifyCSS())
.pipe(gulp.dest("dist/css"))
.pipe(notify({
message: "SASS task completed."
}));
cb();
});
gulp.task("js", function (cb) {
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: "JS task completed."
}));
cb();
});
gulp.task("clean", function (cb) {
gulp.src(["dist/"], { read: false, allowEmpty: true })
.pipe(clean())
cb();
});
gulp.task("setup", function (cb) {
gulp.src(["src/*"], { read: false, allowEmpty: true })
.pipe(gulp.dest("dist/"))
cb();
});
gulp.task("examples", function (cb) {
gulp.src(["node_modules/bootstrap/dist/css/bootstrap.min.css"])
.pipe(gulp.dest("examples/libs"))
gulp.src(["node_modules/bootstrap/dist/js/bootstrap.min.js"])
.pipe(gulp.dest("examples/libs"))
cb();
});
gulp.task("default", gulp.series("clean", "setup", gulp.parallel("js", "sass"), "examples"));
gulp.task('watch', function() {
gulp.series("default")
gulp.watch('src/js/*.js', gulp.series("js"))
gulp.watch('src/sass/*', gulp.series("sass"))
});