-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
109 lines (103 loc) · 2.23 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
/*
* grunt-image-preload
* https://github.com/lexich/grunt-image-preload
*
* Copyright (c) 2013 Efremov Alexey (lexich)
* Licensed under the MIT license.
*/
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Before generating any new files, remove any previously-created files.
clean: {
dist: ['build'],
},
coffee:{
dist:{
options:{
bare:true
},
files:{
"build/backbone-mixin.js":"dist/backbone-mixin.coffee"
}
}
},
uglify:{
dist:{
files:{
"build/backbone-mixin.min.js":"build/backbone-mixin.js"
}
}
},
docco:{
dist:{
src: "dist/backbone-mixin.coffee",
dest: "."
}
},
rename:{
docs:{
src:"docs/backbone-mixin.html",
dest:"docs/index.html"
}
},
git_deploy:{
dist:{
options:{
url:"[email protected]:lexich/backbone-mixin.git",
branch:"gh-pages",
message:"update documentation"
},
src:"docs"
}
},
version:{
dist:{
src:[
"build/*.js",
"dist/*.coffee",
"bower.json"
]
}
},
karma: {
options:{
configFile: 'karma.conf.js',
runnerPort: 9999,
//browsers: ['PhantomJS'],
},
dist: {
singleRun: true
},
watch:{
options:{
browsers: ['Chrome'],
}
}
}
});
grunt.registerTask('build', [
'karma:dist',
'clean:dist',
'coffee:dist',
'uglify:dist',
'version:dist'
]);
grunt.registerTask('docs', [
'docco:dist',
'rename:docs',
'git_deploy:dist'
]);
// By default, lint and run all tests.
grunt.registerTask('default', ['build']);
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-docco');
grunt.loadNpmTasks('grunt-version');
grunt.loadNpmTasks('grunt-git-deploy');
grunt.loadNpmTasks('grunt-rename');
};