-
Notifications
You must be signed in to change notification settings - Fork 8
/
Gruntfile.js
99 lines (88 loc) · 2.66 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: ['dist', 'docco'],
jshint: {
files: {
src: ['src/**/*.js']
}
},
concat: {
all: {
options: {
banner: '/*!\n <%= pkg.name %> <%= pkg.version %>\n' +
' <%= pkg.repository.url %>\n\n' +
' Licensed under the MIT license.\n' +
'*/\n\n' +
'(function (root, factory) {\n\n' +
' if (typeof define === "function" && define.amd) {\n' +
' // AMD (+ global for extensions)\n' +
' define(["underscore", "backbone"], function (_, Backbone) {\n' +
' return (root.BackboneBootstrapModals = factory(_, Backbone));\n' +
' });\n' +
' } else if (typeof exports === "object") {\n' +
' // CommonJS\n' +
' module.exports = factory(require("underscore"), require("backbone"));\n' +
' } else {\n' +
' // Browser\n' +
' root.BackboneBootstrapModals = factory(root._, root.Backbone);\n' +
' }' +
'}(this, function (_, Backbone) {\n\n "use strict";\n\n',
footer: '\n\n return BackboneBootstrapModals;\n' +
'}));'
},
src: [
'src/initializer.js',
'src/base_header_view.js',
'src/base_body_view.js',
'src/base_footer_view.js',
'src/base_modal.js',
'src/confirmation_modal.js',
'src/wizard_modal.js'
],
dest: 'lib/backbone-bootstrap-modals.js'
}
},
uglify: {
options: {
preserveComments: "some"
},
default: {
files: {
"lib/backbone-bootstrap-modals.min.js": ["lib/backbone-bootstrap-modals.js"]
}
}
},
docco: {
debug: {
src: ['lib/backbone-bootstrap-modals.js'],
options: {
output: 'docco/'
}
}
},
mocha: {
test: {
src: ['test/index.html'],
options: {
run: true
}
},
},
watch: {
default: {
files: ['src/**/*.*'],
tasks: ['jshint', 'concat:all']
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks('grunt-docco');
grunt.loadNpmTasks('grunt-mocha');
grunt.registerTask('default', ['clean', 'jshint', 'concat:all', 'mocha', 'uglify']);
};