-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
34 lines (28 loc) · 971 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
var gulp = require("gulp"),
sass = require("gulp-sass"),
autoprefixer = require("gulp-autoprefixer"),
browserSync = require("browser-sync"),
webpack = require("webpack-stream");
gulp.task("sass", function() {
return gulp.src("./resource/assets/sass/**/*.scss")
.pipe(sass())
.pipe(autoprefixer())
.pipe(gulp.dest("./public/assets/css"))
});
gulp.task("watch", function() {
browserSync.init({
server: {
baseDir: "./public/"
}
})
gulp.watch("./resource/assets/sass/**/*.scss", ['sass']);
gulp.watch("./resource/assets/js/**/*.js", ['script']);
gulp.watch("./public/assets/css/**/*.css").on("change", browserSync.reload);
gulp.watch("./public/assets/js/app.js").on("change", browserSync.reload);
gulp.watch("./public/*.html").on("change", browserSync.reload);
});
gulp.task("script", function() {
return gulp.src("./resource/assets/js/**/app.js")
.pipe(webpack(require("./webpack.config.js")))
.pipe(gulp.dest("./public/assets/js"))
})