-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
33 lines (29 loc) · 928 Bytes
/
gulpfile.js
File metadata and controls
33 lines (29 loc) · 928 Bytes
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'),
browsersync = require('browser-sync'),
sass = require('gulp-sass');
//configure browsersync
gulp.task('browser-sync', function(){
var files = [
'./style.css',
'./*.php'
];
//initiliaze browsersync with a php server.
browsersync.init(files, {
proxy:"http://localhost:8888/"
});
});
//configure sass task to run when the specified .scss files change
//browsersync will also reload browsers.
gulp.task('sass', function() {
return gulp.src('sass/*.scss')
.pipe(sass({
'outputStyle': 'compressed'
}))
.pipe(gulp.dest('./'))
.pipe(browsersync.stream());
});
//Create the default task that can be called using gulp
// the task will process sass, run browser-sync and start watching for changes.
gulp.task('default', ['sass','browser-sync'], function() {
gulp.watch("sass/**/*.scss", ['sass']);
});