-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
51 lines (45 loc) · 1.24 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 sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var autoprefixer = require('gulp-autoprefixer');
var browserSync = require('browser-sync').create();
var wait = require('gulp-wait')
gulp.task('scss', function() {
return gulp.src('scss/main.scss')
.pipe(wait(500))
.pipe(sourcemaps.init())
.pipe(sass ({
errLogConsole: true,
outputStyle: 'nested',
sourceComments: false,
}).on("error", sass.logError))
.pipe(autoprefixer({
browsers: [
'last 3 chrome versions',
'last 3 firefox versions',
'last 3 opera versions',
'last 3 safari versions',
'last 3 ios versions',
'android >= 4.0',
'ie >= 10' // change to `last 3 ie versions` after IE12 release.
]
}))
.pipe(sourcemaps.write())
.pipe(gulp.dest('css'))
.pipe(browserSync.reload({
stream: true
}));
})
gulp.task('default', ['browserSync','scss'], function() {
gulp.watch('scss/*/*.scss', ['scss'])
});
// gulp.task("watch",['browserSync','sass'], function () {
// gulp.watch("scss/**/*.scss", ["sass"]);
// });
gulp.task('browserSync', function() {
browserSync.init({
server: {
baseDir: './'
},
});
});