-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
36 lines (32 loc) · 979 Bytes
/
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
// requirements
var gulp = require('gulp');
var sass = require('gulp-sass');
var browserSync = require('browser-sync');
var prefix = require('gulp-autoprefixer');
var rename = require('gulp-rename');
var minifyCSS = require('gulp-minify-css');
// create sass tasks
gulp.task('sass', function () {
gulp.src('scss/**/*.scss')
.pipe(sass({outputStyle: 'expanded', includePaths: ['scss']}))
//.pipe(prefix({browsers: ['last 2 versions'],cascade: true}))
.pipe(gulp.dest('css'))
.pipe(minifyCSS())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('css'));
});
// create browser sync task
gulp.task('browser-sync', function() {
browserSync.init(["css/*.css"], {
server: {
baseDir: "./"
}
});
});
// default task (just run gulp)
gulp.task('default', ['sass']);
gulp.task('watch', ['sass', 'browser-sync'], function () {
gulp.watch("scss/**/*.scss", ['sass']);
});