Skip to content

Commit 50b4023

Browse files
added a gulpfile to help work on CSS with reload
1 parent e4f203e commit 50b4023

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

gulpfile.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
var gulp = require('gulp');
2+
var browserSync = require('browser-sync').create();
3+
var sass = require('gulp-sass');
4+
5+
// Static Server + watching scss/html files
6+
gulp.task('serve', ['sass'], function() {
7+
8+
browserSync.init({
9+
server: "./output/webBook"
10+
});
11+
12+
gulp.watch("static/style/*.scss", ['sass']);
13+
//gulp.watch("output/webBook/chapter/*.html").on('change', browserSync.reload);
14+
gulp.watch("output/webBook/**").on('change', browserSync.reload);
15+
});
16+
17+
// Compile sass into CSS & auto-inject into browsers
18+
gulp.task('sass', function() {
19+
return gulp.src("static/style/style.scss")
20+
.pipe(sass())
21+
.pipe(gulp.dest("output/webBook/style/"))
22+
.pipe(browserSync.stream());
23+
});
24+
25+
gulp.task('default', ['serve']);

0 commit comments

Comments
 (0)