forked from viverae/marionette.formview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
114 lines (109 loc) · 2.75 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
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg : grunt.file.readJSON('package.json'),
banner : '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> */\n',
concat: {
options: {
banner: '<%= banner %>'
},
dist: {
src : ['src/marionette.formview.js'],
dest : 'dist/FormView.js'
}
},
uglify : {
options: {
banner: '<%= banner %>'
},
dist: {
src : '<%= concat.dist.dest %>',
dest : 'dist/FormView.min.js'
}
},
lint : {
src : 'src/**/*.js',
grunt : 'Gruntfile.js',
tests : [
'spec/**/*Spec.js'
]
},
jshint : {
options : {
curly : true,
eqeqeq : true,
immed : true,
latedef : true,
newcap : true,
noarg : true,
sub : true,
undef : true,
boss : true,
eqnull : true,
node : true,
es5 : true,
unused : true
},
globals : {
jQuery : true
},
grunt : {
options : {node : true},
globals : {
task : true,
config : true,
file : true,
log : true,
template : true
}
},
src : {
options : {unused : false}
},
tests : {
globals : {
jasmine : false,
describe : false,
beforeEach : false,
expect : false,
it : false,
spyOn : false,
xit : false
}
}
},
watch : {
files : ['<%= jasmine.specs %>', 'src/*js'],
tasks : 'jasmine'
},
jasmine : {
test: {
src : [
'vendor/jquery-1.8.2.js',
'vendor/underscore-1.4.4.js',
'vendor/backbone-1.0.0.js',
'vendor/backbone.marionette-1.0.3.js',
'src/marionette.formview.js'
],
options : {
helpers : 'spec/helpers/*.js',
specs : [
'spec/**/*Spec.js'
]
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
// Default task.
grunt.registerTask('default', ['lint', 'jasmine']);
grunt.registerTask('test', ['jasmine']);
grunt.registerTask('test-web', ['jasmine-server']);
//Turned LINT off complaining about /*jshint unused:true */
grunt.registerTask('build', ['concat', 'uglify', 'jasmine']);
grunt.registerTask('build-notest', ['lint', 'concat', 'uglify']);
};