forked from planetoftheweb/sassEssentials
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
executable file
·38 lines (33 loc) · 1.01 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
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
sass = require('gulp-ruby-sass'),
sourcemaps = require('gulp-sourcemaps'),
webserver = require('gulp-webserver');
gulp.task('js', function() {
return gulp.src('builds/sassEssentials/js/myscript.js')
.pipe(jshint('./.jshintrc'))
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('sass', function () {
return sass('process/sass/style.scss', {
sourcemap: true,
style: 'expanded'
})
.on('error', function (err) {
console.error('Error!', err.message);
})
.pipe(sourcemaps.write())
.pipe(gulp.dest('builds/sassEssentials/css'));
});
gulp.task('watch', function() {
gulp.watch('builds/sassEssentials/js/**/*', ['js']);
gulp.watch(['process/sass/**/*'], ['sass']);
});
gulp.task('webserver', function() {
gulp.src('builds/sassEssentials/')
.pipe(webserver({
livereload: true,
open: true
}));
});
gulp.task('default', ['watch', 'sass','webserver']);