-
Notifications
You must be signed in to change notification settings - Fork 7
/
Gruntfile.js
99 lines (88 loc) · 2.32 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) {
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-jsdoc');
grunt.initConfig({
'pkg': grunt.file.readJSON('package.json'),
'meta': {
'jsFilesForTesting': [
'bower_components/jquery/jquery.js',
'bower_components/angular/angular.js',
'bower_components/angular-route/angular-route.js',
'bower_components/angular-sanitize/angular-sanitize.js',
'bower_components/angular-mocks/angular-mocks.js',
'bower_components/restangular/dist/restangular.js',
'bower_components/underscore/underscore.js',
'bower_components/underscore/underscore.js',
'test/**/*Spec.js'
]
},
'karma': {
'development': {
'configFile': 'karma.conf.js',
'options': {
'files': [
'<%= meta.jsFilesForTesting %>',
'source/**/*.js'
],
}
},
'dist': {
'options': {
'configFile': 'karma.conf.js',
'files': [
'<%= meta.jsFilesForTesting %>',
'dist/<%= pkg.namelower %>-<%= pkg.version %>.js'
],
}
},
'minified': {
'options': {
'configFile': 'karma.conf.js',
'files': [
'<%= meta.jsFilesForTesting %>',
'dist/<%= pkg.namelower %>-<%= pkg.version %>.min.js'
],
}
}
},
'jshint': {
'beforeconcat': ['source/**/*.js'],
},
'concat': {
'dist': {
'src': ['source/**/*.js'],
'dest': 'dist/<%= pkg.namelower %>-<%= pkg.version %>.js'
}
},
'uglify': {
'options': {
'mangle': false
},
'dist': {
'files': {
'dist/<%= pkg.namelower %>-<%= pkg.version %>.min.js': ['dist/<%= pkg.namelower %>-<%= pkg.version %>.js']
}
}
},
'jsdoc': {
'src': ['source/**/*.js'],
'options': {
'destination': 'doc'
}
}
});
grunt.registerTask('test', ['karma:development']);
grunt.registerTask('build',
[
'jshint',
'karma:development',
'concat',
'karma:dist',
'uglify',
'karma:minified',
'jsdoc'
]);
};