-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.coffee
52 lines (40 loc) · 1.22 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
path = require "path"
http = require "http"
gulp = require "gulp"
jade = require "gulp-jade"
stylus = require "gulp-stylus"
coffee = require "gulp-coffee"
reload = require "gulp-livereload"
express = require "express"
app = express()
app.use express.static path.resolve __dirname, "./www"
port = 5000
gulp.task "server", ->
server = http.Server app
server.listen port
console.log "Server starting on port #{port}"
gulp.task "stylus", ->
gulp.src "./src/css/main.styl"
.pipe stylus()
.pipe gulp.dest "./www/css"
.pipe reload()
gulp.task "jade", ->
gulp.src "./src/**/*.jade"
.pipe jade()
.pipe gulp.dest "./www/"
.pipe reload()
gulp.task "coffee", ->
gulp.src "./src/**/*.coffee"
.pipe coffee()
.pipe gulp.dest "./www/"
.pipe reload()
gulp.task "copy", ->
gulp.src ["./src/**/*", "!./src/**/*.coffee", "!./src/**/*.jade", "!./src/**/*.styl"]
.pipe gulp.dest "./www/"
.pipe reload()
gulp.task "watch", ->
gulp.watch ["./src/**/*.coffee"], ["coffee"]
gulp.watch ["./src/**/*.jade"], ["jade"]
gulp.watch ["./src/**/*.styl"], ["stylus"]
gulp.watch ["!./src/**/*.coffee", "!./src/**/*.jade", "!./src/**/*.styl"], ["copy"]
gulp.task "default", ["stylus", "jade", "coffee", "copy", "watch", "server"]