-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
45 lines (39 loc) · 1.12 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
var gulp = require('gulp');
//var postcss = require('gulp-postcss');
var sass = require('gulp-sass');
var concatCss = require('gulp-concat-css');
var browserSync = require('browser-sync');
var autoprefixer = require('gulp-autoprefixer');
var urlencode = require('gulp-css-urlencode-inline-svgs');
gulp.task('browser-sync', function() {
browserSync({
server: {
baseDir: "./",
index: "index.html"
},
port:3000,
open: true,
notify: false
});
});
gulp.task('html', function(){
gulp.src('./index.html')
.pipe(browserSync.reload({stream:true}));
});
gulp.task('css', function () {
return gulp.src('./scss/**/*.scss')
.pipe(sass({expanded: true}).on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 10 versions'],
cascade: false
}))
.pipe(urlencode())
.pipe(concatCss("./index.css", { rebaseUrls: false }))
.pipe(gulp.dest('./css'))
.pipe(browserSync.reload({stream: true}))
});
gulp.task('watch', function () {
gulp.watch('./scss/**/*.scss', ['css'])
gulp.watch('./index.html', ['html']);
});
gulp.task('default', ['browser-sync', 'css', 'watch']);