forked from Hypercubed/angular-marked
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgruntfile.js
executable file
·65 lines (55 loc) · 1.63 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
module.exports = function(grunt){
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('bower.json'),
jshint: {
options: { jshintrc: true },
all: ['gruntfile.js', '<%= pkg.name %>.js']
},
bump: {
options: {
files: ['bower.json','package.json'],
commit: true,
commitMessage: 'release %VERSION%',
commitFiles: ['package.json','bower.json','<%= pkg.name %>.min.js'],
pushTo: 'origin',
}
},
uglify: {
options: {
banner: '/*\n * <%= pkg.title || pkg.name %> <%= pkg.version %>\n' +
' * (c) <%= grunt.template.today("yyyy") %> <%= pkg.authors.join(" ") %>\n' +
' * Licensed <%= pkg.license %>\n */\n'
},
src: {
files: {
'<%= pkg.name %>.min.js': '<%= pkg.name %>.js'
}
}
},
karma: {
unit: {
configFile: 'karma.conf.js'
},
once: {
configFile: 'karma.conf.js',
singleRun: true,
browsers: ['PhantomJS']
},
server: {
configFile: 'karma.conf.js',
singleRun: false,
autoWatch: true,
browsers: ['PhantomJS']
}
},
'gh-pages': {
src: ['<%= pkg.name %>.js','<%= pkg.name %>.min.js','bower_components/**/*','example/*']
}
});
require('load-grunt-tasks')(grunt);
grunt.registerTask('default', ['test', 'build']);
grunt.registerTask('build', ['jshint', 'uglify']);
grunt.registerTask('test', ['karma:once']);
grunt.registerTask('publish', ['test','bump-only','uglify','bump-commit','gh-pages']);
};