forked from mankindsoftware/angular-isotope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
253 lines (222 loc) · 6.55 KB
/
Gruntfile.js
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
module.exports = function( grunt ) {
'use strict';
require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks);
//
// Grunt configuration:
//
// https://github.com/cowboy/grunt/blob/master/docs/getting_started.md
//
grunt.initConfig({
// Project configuration
// ---------------------
concat: {
dev: {
src: ['app/scripts/config.js', 'app/scripts/services/*.js', 'app/scripts/controllers/*.js', 'app/scripts/directives/*.js', 'app/scripts/module.js'],
dest: 'app/scripts/vendor/infowrap-angular-isotope.js'
},
dist: {
src: ['app/scripts/config.js', 'app/scripts/services/*.js', 'app/scripts/controllers/*.js', 'app/scripts/directives/*.js', 'app/scripts/module.js'],
dest: 'dist/infowrap-angular-isotope.js'
}
},
// specify an alternate install location for Bower
bower: {
dir: 'app/components'
},
clean: [
"dist"
],
// Coffee to JS compilation
coffee: {
dev: {
options: {
bare: true
},
expand: true,
cwd: "app/coffee",
src: ["**/*.coffee"],
dest: "app/scripts",
ext: ".js"
}
},
// compile .scss/.sass to .css using Compass
compass: {
dist: {
// http://compass-style.org/help/tutorials/configuration-reference/#configuration-properties
options: {
css_dir: 'temp/styles',
sass_dir: 'app/styles',
images_dir: 'app/images',
javascripts_dir: 'temp/scripts',
force: true
}
}
},
sass: { // Task
dist: { // Target
files: { // Dictionary of files
'main.css': 'main.scss' // 'destination': 'source'
}
},
dev: { // Another target
options: { // Dictionary of render options
includePaths: [
'path/to/imports/'
]
},
files: {
'main.css': 'main.scss'
}
}
},
// generate application cache manifest
manifest:{
dest: ''
},
// default watch configuration
watch: {
index: {
files: ["app/index.html"],
tasks: ["timestamp"]
},
concat: {
files: 'app/scripts/**/*.js',
tasks: 'concat reload'
},
coffee: {
files: 'app/scripts/**/*.coffee',
tasks: 'coffee reload'
},
compass: {
files: [
'app/styles/**/*.{scss,sass}'
],
tasks: 'compass reload'
},
reload: {
files: [
'app/*.html',
'app/styles/**/*.css',
'app/scripts/**/*.js',
'app/views/**/*.html',
'app/images/**/*'
],
tasks: 'reload'
}
},
changelog: {
options: {
dest: "CHANGELOG.md",
templateFile: "lib/changelog.tpl.md",
github:"https://github.com/infowrap/angular-isotope.git"
}
},
// default lint configuration, change this to match your setup:
// https://github.com/cowboy/grunt/blob/master/docs/task_lint.md#lint-built-in-task
lint: {
files: [
'Gruntfile.js',
'app/scripts/**/*.js',
'spec/**/*.js'
]
},
// specifying JSHint options and globals
// https://github.com/cowboy/grunt/blob/master/docs/task_lint.md#specifying-jshint-options-and-globals
jshint: {
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
browser: true
},
globals: {
angular: true
}
},
// Build configuration
// -------------------
// the staging directory used during the process
staging: 'temp',
// final build output
output: 'dist',
mkdirs: {
staging: 'app/'
},
// Below, all paths are relative to the staging directory, which is a copy
// of the app/ directory. Any .gitignore, .ignore and .buildignore file
// that might appear in the app/ tree are used to ignore these values
// during the copy process.
// concat css/**/*.css files, inline @import, output a single minified css
css: {
'styles/main.css': ['styles/**/*.css']
},
// renames JS/CSS to prepend a hash of their contents for easier
// versioning
rev: {
js: 'scripts/**/*.js',
css: 'styles/**/*.css',
img: 'images/**'
},
// usemin handler should point to the file containing
// the usemin blocks to be parsed
'usemin-handler': {
html: 'index.html'
},
// update references in HTML/CSS to revved files
usemin: {
html: ['**/*.html'],
css: ['**/*.css']
},
// HTML minification
html: {
files: ['**/*.html']
},
// Optimizes JPGs and PNGs (with jpegtran & optipng)
img: {
dist: '<config:rev.img>'
},
// rjs configuration. You don't necessarily need to specify the typical
// `path` configuration, the rjs task will parse these values from your
// main module, using http://requirejs.org/docs/optimization.html#mainConfigFile
//
// name / out / mainConfig file should be used. You can let it blank if
// you're using usemin-handler to parse rjs config from markup (default
// setup)
rjs: {
// no minification, is done by the min task
optimize: 'none',
baseUrl: './scripts',
wrap: true
}
});
grunt.registerTask("preview", "Development build", function() {
grunt.log.writeln("Development build");
grunt.task.run("dev");
});
grunt.registerTask("dev", ["clean", "coffee:dev", "concat:dev", "server", "watch:index"]);
grunt.registerTask("release", ["clean", "coffee:dev", "concat:dist"]);
grunt.registerTask("server", "custom preview server using express", function() {
grunt.log.writeln("Express server listening on port 8000");
require("./app-server.js").listen(8000);
require("child_process").exec("open \"http://localhost:8000\"");
});
// Print a timestamp (useful for when watching)
grunt.registerTask("timestamp", function() {
grunt.log.subhead(Date());
});
// Alias the `test` task to run `testacular` instead
grunt.registerTask('test', 'run the karma test driver', function () {
var done = this.async();
require('child_process').exec('karma start --single-run', function (err, stdout) {
grunt.log.write(stdout);
done(err);
});
});
};