-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.coffee
More file actions
57 lines (45 loc) · 1.47 KB
/
Copy pathgulpfile.coffee
File metadata and controls
57 lines (45 loc) · 1.47 KB
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
gulp = require 'gulp'
gTasks = require 'gulp-tasks'
cPort = Number(process.env.PORT) || 5000
lPort = cPort+1 if cPort?
base = "#{__dirname}/dest"
bower = "#{__dirname}/bower_components"
dest =
base: base
templates: "#{base}/templates"
assets:
"#{base}/assets"
src =
scripts:
main: "#{__dirname}/client/scripts/main.coffee"
watch: "#{__dirname}/client/scripts/**/*.coffee"
templates:
index: "#{__dirname}/client/index.jade"
files: "#{__dirname}/client/templates/**/*.jade"
styles:
index: "#{__dirname}/client/styles/main.less"
files: "#{__dirname}/client/styles/**/*.less"
gulp.task 'build', [
'build:scripts'
'build:templates'
'build:styles'
]
gulp.task 'build:scripts', [
'build:scripts:app'
]
gulp.task 'build:scripts:app', ->
gTasks.browserify.build src.scripts.main, dest.base
gulp.task 'build:templates', ->
gTasks.jade.build src.templates.index, dest.base, lPort
gTasks.jade.build src.templates.files, dest.templates
gulp.task 'build:styles', ->
gTasks.less.build src.styles.index, dest.base
gulp.task 'server', ->
gTasks.livereload.livereloadServer dest.base, lPort
gTasks.livereload.contentServer dest.base, cPort
gulp.task 'start', ['build', 'server']
gulp.task 'watch', ['build', 'server'], ->
gulp.watch src.scripts.watch, ['build:scripts:app']
gulp.watch [src.templates.index, src.templates.files], ['build:templates']
gulp.watch [src.styles.index, src.styles.files], ['build:styles']
gulp.task 'default', ['watch']