-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.coffee
57 lines (50 loc) · 1.49 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
'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'
stylus = require 'gulp-stylus'
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 "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 "stylus", ->
gulp.src source.stylus
.pipe concat "#{pkg.name}.styl"
.pipe(stylus(compress: true, errors: true))
.pipe header banner, pkg: pkg
.pipe gulp.dest "."
.pipe connect.reload()
gulp.task "init", ["coffee", "stylus"]
gulp.task "default", ->
gulp.watch source.coffee, ["coffee"]
gulp.watch source.stylus, ["stylus"]