-
Notifications
You must be signed in to change notification settings - Fork 89
/
gulpfile.js
34 lines (30 loc) · 861 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
var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var cleanCSS = require('gulp-clean-css');
var rename = require('gulp-rename');
var webserver = require('gulp-webserver');
gulp.task('sass', function() {
gulp.src('./assets/sass/style.scss')
.pipe(sass())
.pipe(autoprefixer('last 2 versions'))
.pipe(gulp.dest('./assets/css/'));
});
gulp.task('css', ['sass'], function() {
gulp.src('./assets/css/style.css')
.pipe(cleanCSS())
.pipe(rename({
extname: '.min.css'
}))
.pipe(gulp.dest('./assets/css/'));
});
gulp.task('serve', function() {
gulp.src('.')
.pipe(webserver({
port: 1234,
livereload: true
}));
});
gulp.task('default', ['css', 'serve'], function() {
gulp.watch(['./assets/sass/*.scss', './assets/sass/**/*.scss'], ['css']);
});