-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
67 lines (57 loc) · 1.67 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
var gulp = require('gulp');
var sass = require('gulp-sass');
var browserSync = require('browser-sync').create();
var autoprefixer = require('gulp-autoprefixer');
var target = {
sass_src : 'scss/*.scss',
css_dist : 'css'
};
gulp.task('sass', function () {
return gulp.src(target.sass_src)
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 5 versions','> 1%',
'ie 8',
'ie 9',
'ios 6',
'android 4'],
cascade: true
}))
.pipe(gulp.dest(target.css_dist))
.pipe(browserSync.reload({
stream: true
}))
});
gulp.task('watch', ['browserSync', 'sass'], function(){
/* Para todos los archivos y carpetas dentro de la carpeta scss
gulp.watch('./scss/!**!/!*.scss', ['sass']);
*/
gulp.watch('./scss/*.scss', ['sass']);
gulp.watch('./*.html', browserSync.reload);
});
gulp.task('browserSync', function() {
browserSync.init({
server:{
baseDir: './'
}
})
});
gulp.task('default',['sass', 'watch']);
//gulp.task('sass', function () {
// gulp.src('./style.scss')
// .pipe(sass().on('error', sass.logError))
// .pipe(autoprefixer({
// browsers: ['last 5 versions'],
// cascade: true
// }))
// .pipe(gulp.dest('./'))
// .pipe(browserSync.stream());
//});
//
//gulp.task('default', function () {
// browserSync.init({
// server: "./"
// });
// gulp.watch('./style.scss', ['sass']);
// gulp.watch('./*.html').on('change', browserSync.reload);
//});