-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
58 lines (39 loc) · 1.22 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
//process.env.DISABLE_NOTIFIER = true;
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var sass = require('gulp-ruby-sass');
var autoprefixer = require('gulp-autoprefixer');
var sourcemaps = require('gulp-sourcemaps');
var notify = require('gulp-notify');
var sassLoc = 'scss/style.scss';
var sassDist = "./css/";
var serve = "./";
var watch = 'scss/**/*.scss';
gulp.task('sass', function() {
sass(sassLoc)
.pipe(sourcemaps.init())
.pipe(autoprefixer({
browsers: "> 0%",
cascade: false
}))
.on('error', sass.logError)
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(sassDist))
.pipe(browserSync.stream())
.pipe(notify({
title: "Sass Compiled",
message: "Compiled",
sound: false,
onLast: true
}));
});
gulp.task('browser-sync', function () {
browserSync.init({
server: serve
});
});
gulp.task('default', ["sass", "browser-sync"]);
gulp.watch("./*.html").on('change', browserSync.reload);
gulp.task('watch', ["default"], function () {
gulp.watch(watch,["sass"]);
});