-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
51 lines (44 loc) · 1.16 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
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var sassPaths = [
'bower_components/normalize.scss/sass',
'bower_components/foundation-sites/scss',
'bower_components/motion-ui/src'
];
gulp.task('sass', function() {
return gulp.src('scss/app.scss')
.pipe($.sass({
includePaths: sassPaths,
outputStyle: 'compressed' // if css compressed **file size**
})
.on('error', $.sass.logError))
.pipe($.autoprefixer({
browsers: ['last 2 versions', 'ie >= 9']
}))
.pipe(gulp.dest('css'));
});
// browser-sync task for starting the server.
gulp.task('browser-sync', function() {
//watch files
var files = [
'./style.css',
'./*.php',
'./*.html',
'./template-parts/*.php',
'./inc/*.php',
'./js/*.js',
'css/app.css'
];
//initialize browsersync
browserSync.init(files, {
//browsersync with a php server
proxy: 'veggie.local',
notify: false,
online: true
});
});
gulp.task('default', ['sass', 'browser-sync'], function() {
gulp.watch(['scss/**/*.scss'], ['sass']);
});