This repository has been archived by the owner on Mar 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathGruntfile.js
70 lines (67 loc) · 1.86 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
dist: {
src: [ 'node_modules/marked/lib/marked.js', 'src/jquery.gh-readme.js' ],
dest: 'dist/jquery.gh-readme.full.js'
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> v<%= pkg.version %> */\n'
},
build: {
src: 'dist/jquery.gh-readme.full.js',
dest: 'dist/jquery.gh-readme.min.js'
}
},
mocha: {
test: {
src: [ 'tests/**/*.html' ],
options: {
run: true
}
}
},
jshint: {
files: ['gruntfile.js', 'src/*.js', 'tests/**/*.js'],
options: {
globals: {
jQuery: true,
console: true,
module: true
}
}
},
bump: {
options: {
files: [ 'package.json', 'bower.json' ],
commit: true,
commitMessage: 'increment version to %VERSION%',
commitFiles: [ 'package.json', 'bower.json', 'dist/jquery.gh-readme.min.js' ],
createTag: true,
push: true,
pushTo: 'origin'
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-mocha');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-bump');
grunt.registerTask('default', [ 'concat', 'uglify', 'mocha', 'jshint' ]);
grunt.registerTask('update-pkg', function () {
grunt.config.set('pkg', grunt.file.readJSON('package.json'));
grunt.log.ok('Updated pkg configuration.');
});
grunt.registerTask('build', function (versionType) {
versionType = versionType || 'patch';
grunt.task.run('bump-only:' + versionType);
grunt.task.run('update-pkg');
grunt.task.run('uglify');
grunt.task.run('bump-commit');
});
};