-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
37 lines (36 loc) · 968 Bytes
/
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
const gulp = require("gulp");
const sass = require("gulp-sass");
const browserSync = require("browser-sync").create();
//compile scss into css
function style() {
return gulp
.src("app/src/style.scss")
.pipe(sass().on("error", sass.logError))
.pipe(gulp.dest("app/src/css"))
.pipe(browserSync.stream());
}
//copy bootstrap, jquery, popper.js
function copyjs() {
return gulp
.src([
"node_modules/jquery/dist/jquery.js",
"node_modules/popper.js/dist/umd/popper.js",
"node_modules/bootstrap/dist/js/bootstrap.js"
])
.pipe(gulp.dest("app/src/js"));
}
//gulp-watch
function watch() {
browserSync.init({
server: {
baseDir: "./app",
index: "/index.html"
}
});
gulp.watch("app/src/**/*.scss", style);
gulp.watch("./app/*.html").on("change", browserSync.reload);
gulp.watch("./js/**/*.js").on("change", browserSync.reload);
}
exports.style = style;
exports.watch = watch;
exports.copyjs = copyjs;