-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.coffee
68 lines (59 loc) · 1.46 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
64
65
66
67
68
gulp = require 'gulp'
gutil = require 'gulp-util'
jade = require 'gulp-jade'
stylus = require 'gulp-stylus'
nib = require 'nib'
base64 = require 'gulp-base64'
concat = require 'gulp-concat'
coffee = require 'gulp-coffee'
watch = require 'gulp-watch'
connect = require 'gulp-connect'
gulp.task 'jade', ->
gulp.src 'src/jade/*.jade'
.pipe jade()
.pipe gulp.dest 'public'
.pipe connect.reload()
gulp.task 'stylus', ->
gulp.src 'src/stylus/*.styl'
.pipe stylus {use: [nib()]}
.pipe base64(
baseDir: 'src'
extensions: ['svg', 'png', 'jpg']
maxImageSize: 32*1024
debug: true
)
.pipe concat "main.css"
.pipe gulp.dest 'public/css'
.pipe connect.reload()
gulp.task 'image', ->
gulp.src 'src/image/**'
.pipe gulp.dest 'public/image'
.pipe connect.reload()
gulp.task 'coffee', ->
gulp.src 'src/coffee/*.coffee'
.pipe coffee({ bare: true }).on 'error', gutil.log
.pipe gulp.dest 'public/js'
.pipe connect.reload()
gulp.task 'js', ->
gulp.src 'src/js/*.js'
.pipe gulp.dest 'public/js'
.pipe connect.reload()
gulp.task 'connect', ->
connect.server {
root: 'public'
livereload: true
}
gulp.task 'watch', ->
gulp.watch [
'src/jade/*.jade'
'src/stylus/*.styl'
'src/coffee/*.coffee'
'src/js/*.js'
'src/image/**'
], [
'build'
]
gulp.task 'build',
[ 'jade', 'stylus', 'coffee', 'js', 'image' ]
gulp.task 'default',
[ 'connect', 'watch' ]