forked from WeAthFoLD/Resume
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
36 lines (32 loc) · 1.04 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
var gulp = require('gulp');
var sass = require('gulp-sass');
var prefix = require('gulp-autoprefixer');
var minifyCSS = require('gulp-minify-css');
var rename = require('gulp-rename');
var browserSync = require('browser-sync').create();
// Static server
gulp.task('browser-sync', function() {
browserSync.init({
server: {
baseDir: './'
}
});
});
// Build css files
gulp.task('compressCSS', function() {
gulp.src('src/css/*.scss')
.pipe(sass())
.pipe(prefix(['last 15 versions', '> 1%', 'ie 8', 'ie 7'], { cascade: true }))
.pipe(minifyCSS())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('dist/css'))
.pipe(browserSync.stream());
});
// Watch files for changes & recompile
gulp.task('watch', function () {
gulp.watch(['src/css/*.scss'], ['compressCSS']);
});
// Default task, running just `gulp` will move font, compress js and scss, start server, watch files.
gulp.task('default', ['compressCSS', 'browser-sync', 'watch']);