-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
executable file
·44 lines (32 loc) · 1.02 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
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var $ = require('gulp-load-plugins')();
var path = {
SCSS_SRC : './sass/**/*.scss',
SCSS_DST : './css',
}
gulp.task('sass', function () {
gulp.src( path.SCSS_SRC )
//.pipe($.plumber({errorHandler: $.notify.onError("Error: <%= error.message %>")}))
.pipe($.sourcemaps.init())
.pipe($.sass())
.pipe($.autoprefixer({ browsers: ['last 2 versions'], cascade: false }))
//.pipe($.cssnano())
.pipe($.sourcemaps.write('css'))
//.pipe($.size({ showFiles: true }))
.pipe(gulp.dest( path.SCSS_DST ))
.pipe(browserSync.stream({ match: '**/*.css' }))
;
});
// Static Server + watching scss/html files
gulp.task('serve', ['sass'], function() {
browserSync.init({
proxy: "http://shiftdesign",
port: 8080
});
gulp.watch( path.SCSS_SRC, ['sass']);
gulp.watch("./*.php").on('change', browserSync.reload);
gulp.watch("./js/*.js").on('change', browserSync.reload);
});
// Creating a default task
gulp.task('default', ['sass', 'serve']);