-
Notifications
You must be signed in to change notification settings - Fork 11
/
Gruntfile.js
66 lines (62 loc) · 1.79 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
copy: {
dist: {
expand: true, cwd: 'src/', src: ['**'], dest: 'dist/'
},
site: {
expand: true, cwd: 'dist/', src: ['**/*'], dest: 'site/'
}
},
jshint: {
all: ["src/**/*.js"],
options: {
jshintrc: ".jshintrc"
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
dist: {
files: {
'dist/js/jquery.countimator.min.js': [ 'dist/js/jquery.countimator.js'],
'dist/js/jquery.countimator.wheel.min.js': [ 'dist/js/jquery.countimator.wheel.js']
}
}
},
livemd: {
options: {
prefilter: function(string) {
return string.replace(grunt.config().pkg && grunt.config().pkg.homepage && new RegExp("\\[.*\\]\\(" + grunt.config().pkg.homepage.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&") + "\\)", "gi"), "");
}
},
site: {
files: {
'site/index.html': ['README.md']
}
}
},
'gh-pages': {
options: {
// Options for all targets go here.
},
push: {
options: {
base: 'site'
},
// These files will get pushed to the `gh-pages` branch (the default).
src: ['**/*']
}
}
});
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-livemd');
grunt.loadNpmTasks('grunt-gh-pages');
grunt.registerTask('build', ['copy:dist', 'jshint', 'uglify']);
grunt.registerTask('site', ['build', 'copy:site', 'livemd:site']);
grunt.registerTask('default', ['build']);
};