-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
46 lines (39 loc) · 1.09 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
'use strict';
var gulp = require('gulp'),
sass = require('gulp-sass'),
connect = require('gulp-connect'),
autoprefixer = require('gulp-autoprefixer'),
fileinclude = require('gulp-file-include');
gulp.task('sass', function () {
gulp.src('scss/style.scss')
.pipe(sass({
outputStyle: 'compressed'
}).on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(gulp.dest('./css'))
.pipe(connect.reload());
});
gulp.task('html', function () {
gulp.src('*.html')
.pipe(fileinclude({
prefix: '@@',
basepath: '_partials/'
}))
.pipe(gulp.dest('./.tmp'))
.pipe(connect.reload());
});
gulp.task('watch', ['sass'], function () {
gulp.watch('**/*.scss', ['sass']);
gulp.watch('**/*.html', ['html']);
});
gulp.task('webserver', function () {
connect.server({
root: ['.tmp', '.'],
livereload: true,
post: 1337
});
});
gulp.task('default', ['html', 'webserver', 'watch']);