-
Notifications
You must be signed in to change notification settings - Fork 301
/
Gruntfile.coffee
119 lines (94 loc) · 2.66 KB
/
Gruntfile.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
module.exports = (grunt)->
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
jade:
dev:
options:
pretty:true
files:
'temp/_template.html':'src/abn_tree_template.jade'
'test/tests_page.html':'test/tests_page.jade'
#
# Generate 4 test pages, for all combinations of:
#
# Bootstrap 2 and 3
# Angular 1.1.5 and 1.2.0
#
bs2_ng115_test_page:
files:
'test/bs2_ng115_test_page.html':'test/test_page.jade'
options:
pretty:true
data:
bs:"2"
ng:"1.1.5"
bs3_ng115_test_page:
files:
'test/bs3_ng115_test_page.html':'test/test_page.jade'
options:
pretty:true
data:
bs:"3"
ng:"1.1.5"
bs2_ng120_test_page:
files:
'test/bs2_ng120_test_page.html':'test/test_page.jade'
options:
pretty:true
data:
bs:"2"
ng:"1.2.12"
bs3_ng120_test_page:
files:
'test/bs3_ng120_test_page.html':'test/test_page.jade'
options:
pretty:true
data:
bs:"3"
ng:"1.2.12"
"string-replace":
dev:
files:
#
# substitute the "template html" into an intermediate coffeescript file
# ( to take advantage of triple-quoted strings )
#
'temp/_directive.coffee':'src/abn_tree_directive.coffee'
options:
replacements:[
pattern: "{html}"
replacement_old: "<h1>i am the replacement!</h1>"
replacement: (match, p1, offset, string)->
grunt.file.read('temp/_template.html')
]
coffee:
dev:
options:
bare:false
files:
#
# the _temp.coffee file has the "template html" baked-in by Grunt
#
'dist/abn_tree_directive.js':'temp/_directive.coffee'
'test/test_page.js':'test/test_page.coffee'
watch:
jade:
files:['**/*.jade']
tasks:['jade','string-replace']
options:
livereload:true
css:
files:['**/*.css']
tasks:[]
options:
livereload:true
coffee:
files:['**/*.coffee']
tasks:['jade','string-replace','coffee']
options:
livereload:true
grunt.loadNpmTasks 'grunt-contrib-jade'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-string-replace'
grunt.registerTask 'default', ['jade','string-replace','coffee','watch']