-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
54 lines (43 loc) · 1.34 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
46
47
48
49
50
51
52
53
54
var gulp = require('gulp');
var del = require('del');
var haml = require('gulp-ruby-haml');
var sass = require('gulp-ruby-sass');
var connect = require('gulp-connect');
gulp.task('clean', function () {
return del('./build/**/*');
});
gulp.task('haml', ['clean'], function() {
gulp.src('./app/haml/**/*.haml')
.pipe(haml())
.pipe(gulp.dest('./build/html'));
gulp.src('./app/index.haml')
.pipe(haml())
.pipe(gulp.dest('./build'));
});
gulp.task('sass', ['clean'], function() {
return sass('./app/scss/**/*.scss', {emitCompileError: true})
.pipe(gulp.dest('./build/css'));
});
gulp.task('js', ['clean'], function() {
gulp.src('./app/js/**/*.js')
.pipe(gulp.dest('./build/js'));
});
gulp.task('bower', ['clean'], function() {
gulp.src('./bower_components/angular/angular.min.js')
.pipe(gulp.dest('./build/js'));
gulp.src('./bower_components/angular-route/angular-route.min.js')
.pipe(gulp.dest('./build/js'));
gulp.src('./bower_components/jquery/dist/jquery.min.js')
.pipe(gulp.dest('./build/js'));
});
gulp.task('server', function() {
connect.server({
root: 'build',
livereload: true
});
});
gulp.task('default', ['haml', 'sass', 'js', 'bower', 'server']);
gulp.watch('app/**/*', ['haml', 'sass', 'js', 'bower']);
gulp.watch('app/**/*', function(event) {
console.log('> > > ' + event.path + ' ' + event.type);
});