-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
42 lines (33 loc) · 1.05 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
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var sass = require('gulp-sass');
var browserSync = require('browser-sync').create();
var sourcemaps = require('gulp-sourcemaps');
gulp.task('default', ['watch']);
gulp.task('sass', function () {
return gulp.src("scss/**/*.scss")
.pipe(sourcemaps.init())
.pipe(sass({
sourceComments: 'map',
outputStyle: 'expanded'
}).on('error', sass.logError))
.pipe(sourcemaps.write())
.pipe(gulp.dest("css"))
.pipe(browserSync.stream());
});
gulp.task('serve', ['sass'], function () {
browserSync.init({
server: "./"
});
gulp.watch("./scss/**/*.scss", ['sass']);
gulp.watch("./*.html").on('change', browserSync.reload);
});
gulp.task('default', ['serve']);
gulp.task('jshint', function () {
return gulp.src('source/javascript/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('watch', function () {
gulp.watch('source/javascript/**/*.js', ['jshint']);
});