-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
45 lines (36 loc) · 1 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
const gulp = require("gulp");
const concat = require("gulp-concat");
const sass = require("gulp-sass")(require("sass"));
const minify = require("gulp-minify");
const sourcemaps = require("gulp-sourcemaps");
const deploy = require("gulp-gh-pages");
// SASS Task
gulp.task("css", () => {
return gulp
.src("src/style/scss/**/*.scss")
.pipe(sourcemaps.init())
.pipe(sass().on("error", sass.logError))
.pipe(concat("main.css"))
.pipe(sourcemaps.write("."))
.pipe(gulp.dest("dist/"));
});
// JS Task
gulp.task("js", () => {
return gulp
.src("src/js/*.js")
.pipe(concat("main.js"))
.pipe(minify())
.pipe(gulp.dest("dist/js"));
});
// Watch Task
gulp.task("watch", () => {
gulp.watch("src/style/scss/**/*.scss", gulp.series(["css"]));
gulp.watch("src/js/*.js", gulp.series(["js"]));
});
gulp.task('deploy', function () {
return gulp.src("./dist/**/*")
.pipe(deploy({
remoteUrl: "https://github.com/medhatnasra/Gulpjs-Website-.git",
branch: "master"
}))
});