-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
81 lines (74 loc) · 2.42 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
73
74
75
76
77
78
79
80
81
let gulp = require("gulp"),
sass = require("gulp-sass"),
rename = require("gulp-rename"),
browserSync = require("browser-sync"),
autoprefixer = require("gulp-autoprefixer"),
concat = require("gulp-concat"),
uglify = require("gulp-uglify"),
cssmin = require("gulp-cssmin");
gulp.task("sass", function() {
return gulp
.src("app/scss/**/*.scss", "app/scss/style.scss")
.pipe(sass({ outputStyle: "compressed" }))
.pipe(rename({ suffix: ".min" }))
.pipe(
autoprefixer({
overrideBrowsers: ["last 8 versions"]
})
)
.pipe(gulp.dest("app/css"))
.pipe(browserSync.reload({ stream: true }));
});
gulp.task("style", function() {
return gulp
.src([
"node_modules/normalize.css/normalize.css",
"node_modules/slick-carousel/slick/slick.css",
"node_modules/magnific-popup/dist/magnific-popup.css",
"node_modules/rateyo/src/jquery.rateyo.css",
"node_modules/ion-rangeslider/css/ion.rangeSlider.css",
"node_modules/@fancyapps/fancybox/dist/jquery.fancybox.css",
"node_modules/jquery-form-styler/dist/jquery.formstyler.css",
"node_modules/jquery-form-styler/dist/jquery.formstyler.theme.css"
])
.pipe(concat("libs.min.css"))
.pipe(cssmin())
.pipe(gulp.dest("app/css"));
});
gulp.task("script", function() {
return gulp
.src([
"node_modules/slick-carousel/slick/slick.js",
"node_modules/magnific-popup/dist/jquery.magnific-popup.js",
"node_modules/mixitup/dist/mixitup.js",
"node_modules/rateyo/src/jquery.rateyo.js",
"node_modules/ion-rangeslider/js/ion.rangeSlider.js",
"node_modules/@fancyapps/fancybox/dist/jquery.fancybox.js",
"node_modules/jquery-form-styler/dist/jquery.formstyler.js"
])
.pipe(concat("libs.min.js"))
.pipe(uglify())
.pipe(gulp.dest("app/js"));
});
gulp.task("html", function() {
return gulp.src("app/*.html").pipe(browserSync.reload({ stream: true }));
});
gulp.task("js", function() {
return gulp.src("app/js/*.js").pipe(browserSync.reload({ stream: true }));
});
gulp.task("browser-sync", function() {
browserSync.init({
server: {
baseDir: "app/"
}
});
});
gulp.task("watch", function() {
gulp.watch("app/scss/**/*.scss", gulp.parallel("sass"));
gulp.watch("app/*.html", gulp.parallel("html"));
gulp.watch("app/js/*.js", gulp.parallel("js"));
});
gulp.task(
"default",
gulp.parallel("style", "script", "sass", "watch", "browser-sync")
);