This repository has been archived by the owner on Aug 25, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 77
/
Gruntfile.js
113 lines (100 loc) · 2.3 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
/* global module */
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
concat: {
dist: {
src: ['src/backbonefire.js'],
dest: 'dist/backbonefire.js'
}
},
uglify : {
options: {
preserveComments: "some"
},
app : {
files : {
'dist/backbonefire.min.js' : ['src/backbonefire.js']
}
}
},
jshint : {
options : {
'bitwise' : true,
'boss' : true,
'browser' : true,
'curly' : true,
'devel' : true,
'eqnull' : true,
'globals' : {
'Backbone' : false,
'Firebase' : false
},
'globalstrict' : true,
'indent' : 2,
'latedef' : true,
'maxlen' : 115,
'noempty' : true,
'nonstandard' : true,
'undef' : true,
'unused' : true,
'trailing' : true
},
all : ['src/backbonefire.js']
},
watch : {
scripts : {
files : 'src/backbonefire.js',
tasks : ['default', 'notify:watch'],
options : {
interrupt : true
}
}
},
notify: {
watch: {
options: {
title: 'Grunt Watch',
message: 'Build Finished'
}
}
},
// Unit tests
karma: {
options: {
configFile: 'test/karma.conf.js',
},
unit: {
autowatch: false,
singleRun: true
}
},
copy: {
main: {
src: 'src/backbonefire.js',
dest: 'examples/todos/js/backbonefire.js',
},
},
serve: {
options: {
port: 9000,
'serve': {
'path': 'examples/todos'
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-notify');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-copy');
grunt.loadNpmTasks('grunt-serve');
// Unit tests
grunt.registerTask('test', ['karma:unit']);
grunt.registerTask('build', ['jshint', 'concat', 'uglify']);
grunt.registerTask('default', ['build', 'test']);
grunt.registerTask('todo', ['build', 'serve']);
};