-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.ls
84 lines (71 loc) · 2 KB
/
gulpfile.ls
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
gulp = require 'gulp'
browserify = require 'gulp-browserify'
ls = require 'gulp-livescript'
connect = require 'gulp-connect'
rename = require 'gulp-rename'
uglify = require 'gulp-uglify'
mocha = require 'gulp-mocha'
less = require 'gulp-less'
jade = require 'gulp-jade'
dist = './dist'
err = (e)->
console.error e
this.emit 'end'
gulp.task 'js', ->
gulp.src 'src/**/*.js'
.pipe gulp.dest "#{dist}/js"
gulp.task 'ls', ->
gulp.src 'src/**/*.ls'
.pipe ls!.on('error', err)
.pipe gulp.dest "#{dist}/js"
gulp.task 'test', ['js', 'ls'], ->
# Run unit tests first
gulp.src "#{dist}/js/test/unit-*.js"
.pipe mocha!
# Compile browser tests
gulp.src "#{dist}/js/test/test.js"
.pipe browserify!
.pipe rename {suffix: '.bundle'}
.pipe gulp.dest "#{dist}/test"
#.pipe connect.reload!
/*
gulp.task 'browsertest', ->
gulp.src "#{dist}/test/index.html"
.pipe mochaPhantom!
*/
gulp.task 'main', ['ls'], ->
gulp.src "#{dist}/js/main.js"
.pipe browserify!
.pipe rename {suffix: '.bundle'}
.pipe gulp.dest dist
#.pipe uglify!
#.pipe rename {suffix: '.min'}
#.pipe gulp.dest dest
.pipe connect.reload!
gulp.task 'less', ->
gulp.src "styles/teztura.less"
.pipe less!.on('error', err)
.pipe gulp.dest "#{dist}/css"
.pipe connect.reload!
gulp.task 'templates', ->
gulp.src "templates/index.jade"
.pipe jade {
pretty: true
}
.pipe gulp.dest "#{dist}"
.pipe connect.reload!
gulp.task 'bootstrap', ->
gulp.src "styles/bootstrap/bootstrap.less"
.pipe less!.on('error', err)
.pipe gulp.dest "#{dist}/css"
.pipe connect.reload!
gulp.task 'connect', ->
connect.server do
root: dist
port: 8000
livereload: true
gulp.task 'serve', ['test', 'main', 'connect'], ->
gulp.watch ['src/**/*'], ['test', 'main']
gulp.watch ['styles/*.less'], ['less']
gulp.watch ['styles/bootstrap/*.less'], ['bootstrap']
gulp.watch ['templates/*.jade'], ['templates']