/
Gruntfile.js
127 lines (121 loc) · 3.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
module.exports = function(grunt)
{
grunt.initConfig({
pkg: '<json:package.json>',
meta: {
banner: '/*!=========================================================\n' +
'* <%= pkg.name %> v<%= pkg.version %> - <%= grunt.template.today("m/d/yyyy") %>\n' +
'* <%= pkg.homepage %>\n' +
'* HEAVILY based off bootstrap-modal.js\n'+
'* ==========================================================\n' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
'*\n' +
'* Licensed under the Apache License, Version 2.0 (the "License");\n' +
'* you may not use this file except in compliance with the License.\n' +
'* You may obtain a copy of the License at\n' +
'*\n' +
'* http://www.apache.org/licenses/LICENSE-2.0\n' +
'*\n' +
'* Unless required by applicable law or agreed to in writing, software\n' +
'* distributed under the License is distributed on an "AS IS" BASIS,\n' +
'* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n' +
'* See the License for the specific language governing permissions and\n' +
'* limitations under the License.\n' +
'* ========================================================= */\n'
},
lint: {
all: ['js/*.js']
},
jshint: {
options: {
"validthis": true,
"laxbreak" : true,
"browser" : true,
"eqnull" : true,
"boss" : true,
"expr" : true,
"asi" : true
},
globals: {
"jQuery" : true
}
},
concat: {
js: {
src: ['<banner>', '<file_strip_banner:js/bootstrap-lightbox.js>'],
dest: 'build/bootstrap-lightbox.js'
},
less: {
src: ['<banner>', '<file_strip_banner:less/bootstrap-lightbox.less>'],
dest: 'build/bootstrap-lightbox.less'
}
},
min: {
dist: {
src: ['<banner>', '<file_strip_banner:js/bootstrap-lightbox.js>'],
dest: 'build/bootstrap-lightbox.min.js'
}
},
less: {
"dist": {
options: {
paths: [
"build",
"less"
]
},
files: {
"build/bootstrap-lightbox.css" : "build/bootstrap-lightbox.less"
}
},
"distmin": {
options: {
paths: [
"build",
"less"
],
yuicompress: true
},
files: {
"build/bootstrap-lightbox.min.css" : "build/bootstrap-lightbox.less"
}
}
},
clean: {
dist: [
"build/bootstrap-lightbox.less"
]
},
copy: {
dist: {
files: {
"docs/assets/js/": "build/bootstrap-lightbox.min.js",
"docs/assets/css/": "build/bootstrap-lightbox.min.css",
}
}
},
exec: {
docs_dep: {
command: 'cd docs/build;npm install'
},
build_docs: {
command: 'node docs/build'
}
},
qunit: {
all: [
'test/**.html'
]
}
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-exec');
// Default task.
grunt.registerTask('default', 'qunit lint concat min less copy');
grunt.registerTask('docs', 'exec:docs_dep exec:build_docs');
grunt.registerTask('test', 'qunit lint');
};