-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
43 lines (37 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 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');
gulp.task('browser-sync', function() {
browserSync({
server: {
baseDir: "./",
index: "main.html"
},
port:3000,
open: true,
notify: false
});
});
gulp.task('html', function(){
gulp.src('/main.html')
.pipe(reload({stream:true}));
});
gulp.task('css', function () {
return gulp.src('./assets/scss/*.scss')
.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(concatCss("./bundle.css"))
.pipe(gulp.dest('./assets/css'))
.pipe(browserSync.reload({stream: true}))
});
gulp.task('watch', function () {
gulp.watch('./assets/scss/*.scss', ['css'])
gulp.watch('/main.html', ['html']);
});
gulp.task('default', ['browser-sync','watch']);