-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathGruntfile.js
75 lines (72 loc) · 1.81 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
/*global module:false*/
module.exports = function(grunt){
"use strict";
var pkgConfig = grunt.file.readJSON('package.json');
pkgConfig.version = grunt.file.readJSON('version.json').version;
// Project configuration.
grunt.initConfig({
pkg : pkgConfig,
uglify : {
options : {
banner : '/*! <%= pkg.name %> - v<%= pkg.version %> - ' + '<%= grunt.template.today("yyyy-mm-dd") %> ' + 'Copyright (c) <%= grunt.template.today("yyyy") %> ' + '<%= pkg.author %>; Licensed <%= pkg.licenses[0].type %> */'
},
build : {
src : 'dist/<%= pkg.name %>.js',
dest : 'dist/<%= pkg.name %>.min.js'
}
},
watch : {
files : '<config:lint.files>',
tasks : 'lint test'
},
jshint : {
all : ['Gruntfile.js', 'src/**/*.js', 'specs/**/*.js'],
options : {
jshintrc : '.jshintrc'
}
},
concat : {
source : {
src : ['src/**/*.js'],
dest : 'dist/<%= pkg.name %>.js'
}
},
jasmine : {
source : ['src/**/*.js'],
dist : ['bin/*.min.js'],
options : {
specs : ['specs/**/*.js']
}
},
jsdoc : {
dist : {
src : ['src/*.js'],
options : {
destination : 'docs',
private : false
}
}
},
version : {
defaults : {
src : [
'package.json', 'bower.json', 'src/<%= pkg.name %>.js'
]
}
},
clean:{
dist: ['dist']
}
});
grunt.loadNpmTasks('grunt-jsdoc');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-version');
grunt.loadNpmTasks('grunt-contrib-clean');
// Default task.
grunt.registerTask('test', ['jasmine:source']);
grunt.registerTask('build', ['version', 'test', 'clean:dist', 'concat', 'uglify']);
grunt.registerTask('docs', ['jsdoc']);
};