-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.coffee
63 lines (55 loc) · 1.59 KB
/
gulpfile.coffee
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
'use strict'
gulp = require 'gulp'
coffee = require 'gulp-coffee'
concat = require 'gulp-concat'
connect = require 'gulp-connect'
header = require 'gulp-header'
uglify = require 'gulp-uglify'
gutil = require 'gulp-util'
pkg = require './package.json'
source =
coffee: [ "atom/*.coffee"
"molecule/*.coffee"
"organism/*.coffee"]
stylus: [ "bower_components/stylmethods/vendor.styl"
"style/*.styl"]
test : [ "test/atom/*.coffee"
"test/molecule/*.coffee"
"test/organism/*.coffee"
"test/entity/*.coffee"
"test/app.coffee"]
banner = [
"/**"
" * <%= pkg.name %> - <%= pkg.description %>"
" * @version v<%= pkg.version %>"
" * @link <%= pkg.homepage %>"
" * @author <%= pkg.author.name %> (<%= pkg.author.site %>)"
" * @license <%= pkg.license %>"
" */"
""
].join("\n")
gulp.task "webserver", ->
connect.server
port : 8080
livereload: true
gulp.task "coffee", ->
gulp.src source.coffee
.pipe concat "#{pkg.name}.coffee"
.pipe coffee().on "error", gutil.log
.pipe uglify mangle: false
.pipe header banner, pkg: pkg
.pipe gulp.dest "."
.pipe connect.reload()
gulp.task "test", ->
gulp.src source.test
.pipe concat "#{pkg.name}.coffee"
.pipe coffee().on "error", gutil.log
.pipe uglify mangle: false
.pipe header banner, pkg: pkg
.pipe gulp.dest "test/"
.pipe connect.reload()
gulp.task "init", ["coffee", "test"]
gulp.task "default", ->
gulp.run ["webserver"]
gulp.watch source.coffee, ["coffee"]
gulp.watch source.test, ["test"]