-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
45 lines (39 loc) · 1.21 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
43
44
45
var gulp = require('gulp'),
babel = require('gulp-babel'),
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/site/js/myscript.js')
.pipe(jshint('./.jshintrc'))
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('sass', function () {
return sass('process/sass/KleiserAudioPlayerStyles.scss', {
sourcemap: true,
style: 'expanded'
})
.on('error', function (err) {
console.error('Error!', err.message);
})
.pipe(sourcemaps.write())
.pipe(gulp.dest('builds/site/css'));
});
gulp.task('watch', function() {
gulp.watch('builds/site/js/**/*', ['js']);
gulp.watch(['process/sass/**/*'], ['sass']);
});
gulp.task('webserver', function() {
gulp.src('builds/site')
.pipe(webserver({
livereload: true,
open: true
}));
});
gulp.task('babel', function () {
return gulp.src('builds/site/js/**/*')
.pipe(babel())
.pipe(gulp.dest('builds/site/js/es5'));
});
gulp.task('default', ['sass', 'watch', 'webserver']);