-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathGruntfile.coffee
More file actions
261 lines (235 loc) · 5.87 KB
/
Copy pathGruntfile.coffee
File metadata and controls
261 lines (235 loc) · 5.87 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
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
module.exports = (grunt) ->
# -----------------------------------
# load Plugins
# -----------------------------------
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);
appConfig =
config:
src: "config/grunt/*"
paths:
dist: "dist"
src: "src"
demo: 'demo'
tmp: ".tmp"
grunt.config.init
compass:
options:
sassDir: "demo/styles"
cssDir: ".tmp/styles"
generatedImagesDir: "#{appConfig.paths.tmp}/images/generated"
imagesDir: "#{appConfig.paths.demo}/images"
javascriptsDir: "#{appConfig.paths.demo}/scripts"
fontsDir: "#{appConfig.paths.demo}/fonts"
importPath: "./bower_components"
httpImagesPath: "/images"
httpGeneratedImagesPath: "/images/generated"
httpFontsPath: "/fonts"
relativeAssets: false
assetCacheBuster: false
raw: "Sass::Script::Number.precision = 10\n"
dist:
options:
debugInfo: false
server:
options:
debugInfo: true
watch: false
dev:
options:
debugInfo: true
watch: true
clean:
dist:
files: [
{
dot: true
src: ['dist']
}
]
dev:
files: [
{
dot: true
src: ['.tmp']
}
]
docs:
files: [
{
dot: true
src: ['docs']
}
]
coffee:
api:
expand: true
cwd: 'src'
src: ['module.coffee'
'providers/*.coffee'
'directives/*.coffee'
'default/*.coffee']
dest: '.tmp/scripts'
ext: '.js'
demo:
files:
'.tmp/scripts/demo.js': 'demo/scripts/demo.coffee'
jade:
options:
sourceMap: true
sourceRoot: ""
index:
options:
pretty: true
files: [
expand: true
pretty: true
cwd: "#{appConfig.paths.demo}"
src: "*.jade"
dest: "#{appConfig.paths.tmp}"
ext: ".html"
]
concat:
options:
separator: ';'
dist:
src: ['.tmp/scripts/module.js'
'.tmp/scripts/providers/*.js'
'.tmp/scripts/directives/*.js'
'.tmp/scripts/default/*.js'
'.tmp/scripts/templates.js']
dest: 'dist/angular-easy-form.js'
ngAnnotate:
options:
singleQuotes: true
dist:
files:
'dist/angular-easy-form.js': ['dist/angular-easy-form.js']
uglify:
build:
files:
'dist/angular-easy-form.min.js': 'dist/angular-easy-form.js'
watch:
coffee:
files: ['src/**/*.coffee', 'demo/**/*.coffee']
tasks: ['coffee']
options:
spawn: no
jade:
files: ["demo/index.jade"]
tasks: ["jade"]
html2js:
files: ['src/templates/**/*.html']
tasks: ['html2js']
livereload:
options:
livereload: "<%= connect.options.livereload %>"
spawn: false
files: [
"#{appConfig.paths.demo}/*.html"
"#{appConfig.paths.tmp}/styles/{,*/}{,*/}{,*/}*.css"
"#{appConfig.paths.tmp}/scripts/**/*.js"
"#{appConfig.paths.tmp}/views/**/*.html"
"#{appConfig.paths.app}/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}"
]
html2js:
options:
base: '.'
module: 'easy.form.templates'
rename: (modulePath) ->
moduleName = modulePath.replace('src/', '').replace('.html', '');
return 'easy-form' + '/' + moduleName + '.html'
default:
src: ['src/templates/**/*.html']
dest: '.tmp/scripts/templates.js'
connect:
options:
port: 9000
hostname: "localhost"
livereload: 35729
livereload:
options:
open: true
middleware: (connect) ->
[
connect.static(".tmp")
connect.static('demo')
connect().use("/bower_components", connect.static("./bower_components"))
]
karma:
dev:
configFile: 'test/karma-dev.conf.js'
dist:
configFile: 'test/karma-dist.conf.js'
wiredep:
demo:
src: ['demo/index.jade']
ignorePath: /\.\.\//
sass:
src: ["#{appConfig.paths.demo}/styles/{,*/}*.{scss,sass}"]
ignorePath: /(\.\.\/){1,2}bower_components\//
test:
src: ['test/karma.conf.coffee'],
ignorePath: '../'
devDependencies: true
fileTypes:
js:
block: /(([\s\t]*)\/\/\s*bower:*(\S*))(\n|\r|.)*?(\/\/\s*endbower)/gi,
detect: {}
replace:
js: '\'{{filePath}}\','
ngdocs:
options:
dest: 'docs'
title: "Angular Easy form"
startPage: '/api'
api:
src: ['.tmp/module.js',
'.tmp/providers/*.js',
'.tmp/directives/input.js']
title: 'API Documentation'
tutorial:
src: 'content/tutorial/*.ngdoc'
title: 'Tutorial'
# Run some tasks in parallel to speed up the build process
concurrent:
dev: [
"coffee"
"jade"
"compass:server"
]
test: [
"coffee"
"jade"
"compass:server"
]
dist: [
"coffee"
"jade"
]
# -----------------------------------
# register task
# -----------------------------------
grunt.registerTask 'dev', [
'clean:dev'
'wiredep'
"concurrent:dev"
'html2js'
'connect:livereload'
'watch'
]
grunt.registerTask 'build', [
'clean'
'wiredep'
"concurrent:dist"
'html2js'
'concat'
'ngAnnotate'
'uglify'
]
grunt.registerTask 'test', ['karma']
grunt.registerTask 'docs', [
'clean:docs',
'build'
'ngdocs'
]