-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
64 lines (52 loc) · 1.78 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
55
56
57
58
59
60
61
62
63
var gulp = require('gulp'),
gutil = require('gulp-util'),
sass = require('gulp-sass'),
livereload = require('gulp-livereload'),
coffee = require('gulp-coffee'),
connect = require('gulp-connect'),
historyApiFallback = require('connect-history-api-fallback'),
webserver = require('gulp-webserver')
gulp.task('styles', function() {
gulp.src('./src/scss/*.scss')
.pipe(sass())
.pipe(gulp.dest('./dist/css/'))
.pipe(connect.reload())
})
gulp.task('coffee', function() {
gulp.src('./src/coffee/**')
.pipe(coffee())
.pipe(gulp.dest('dist/js/'))
.pipe(connect.reload())
})
gulp.task('html', function() {
gulp.src('./src/html/**')
.pipe(gulp.dest('dist/html'))
.pipe(connect.reload())
})
gulp.task('third-party', function() {
gulp.src('./src/third-party/angular/angular.js')
.pipe(gulp.dest('dist/third-party/angular/'))
gulp.src('./src/third-party/angular-route/angular-route.min.js')
.pipe(gulp.dest('dist/third-party/angular-route/'))
gulp.src('./src/third-party/angular-resource/angular-resource.min.js')
.pipe(gulp.dest('dist/third-party/angular-resource/'))
gulp.src('./src/third-party/bootstrap/dist/**')
.pipe(gulp.dest('dist/third-party/bootstrap/'))
gulp.src('./src/third-party/jquery/dist/**')
.pipe(gulp.dest('dist/third-party/jquery/'))
})
connectOptions = {
host: '127.0.0.1',
livereload: false,
fallback: 'html/index.html',
proxies: [
{ source: '/api/v1/', target: 'http://127.0.0.1:5000/api/v1/'}
]
}
gulp.task('webserver', function() {
gulp.src('dist')
.pipe(webserver(connectOptions))
})
gulp.task('watch', function(){
gulp.watch(['./src/**'], ['html', 'styles', 'coffee', 'third-party'])
})