-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
37 lines (33 loc) · 1.06 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
var gulp = require('gulp');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var localPath = require("./build/js/config.js");
// browser-sync task for starting the server.
gulp.task('browser-sync', function() {
//watch files
var files = [
'./*.css',
'./*.php'
];
//initialize browsersync
browserSync.init(files, {
//browsersync with a php server
proxy: localPath,
notify: false
});
});
// Sass task, will run when any SCSS files change & BrowserSync
// will auto-update browsers
gulp.task('sass', function(){
gulp.src('assets/sass/*.scss') // select all css files in css/ folder
.pipe(sass({outputStyle : 'compressed'}))
.pipe(autoprefixer('last 2 versions'))
.pipe(gulp.dest('build/css/'))
.pipe(reload({stream:true}));
});
// Default task to be run with `gulp`
gulp.task('default', ['sass', 'browser-sync'], function () {
gulp.watch("assets/sass/**/*.scss", ['sass']);
});