8dde46ca110e2c52e3248d4c3ff7ca8b294cc35a.svn-base
2.1 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
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({{% if (min_concat) { if (package_json) { %}
pkg: '<json:package.json>',
meta: {
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
},{% } else { %}
meta: {
version: '0.1.0',
banner: '/*! PROJECT_NAME - v<%= meta.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'* http://PROJECT_WEBSITE/\n' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> ' +
'YOUR_NAME; Licensed MIT */'
},{% } } %}
lint: {
files: ['grunt.js', '{%= lib_dir %}/**/*.js', '{%= test_dir %}/**/*.js']
},{% if (dom) { %}
qunit: {
files: ['{%= test_dir %}/**/*.html']
},{% } else { %}
test: {
files: ['{%= test_dir %}/**/*.js']
},{% } %}{% if (min_concat) { %}
concat: {
dist: {
src: ['<banner:meta.banner>', '<file_strip_banner:{%= lib_dir %}/{%= file_name %}.js>'],
dest: 'dist/{%= file_name %}.js'
}
},
min: {
dist: {
src: ['<banner:meta.banner>', '<config:concat.dist.dest>'],
dest: 'dist/{%= file_name %}.min.js'
}
},{% } %}
watch: {
files: '<config:lint.files>',
tasks: 'lint {%= test_task %}'
},
jshint: {
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true{% if (dom) { %},
browser: true{% } %}
},
globals: {{% if (jquery) { %}
jQuery: true
{% } %}}
}{% if (min_concat) { %},
uglify: {}{% } %}
});
// Default task.
grunt.registerTask('default', 'lint {%= test_task %}{%= min_concat ? " concat min" : "" %}');
};