-
Notifications
You must be signed in to change notification settings - Fork 5
/
Gruntfile.js
79 lines (73 loc) · 1.96 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
bower_concat: {
all: {
dest: 'js/_bower.js',
bowerOptions: {
relative: false
}
}
},
concat: {
options: {
// define a string to put between each file in the concatenated output
separator: ';'
},
dist: {
// the files to concatenate
src: ['js/**/*.js'],
// the location of the resulting JS file
dest: 'js/main.js'
}
},
jshint: {
files: ['Gruntfile.js', 'js/<%= pkg.name %>.js'],
options: {
// options here to override JSHint defaults
globals: {
jQuery: true,
console: true,
module: true,
document: true
}
}
},
shell: {
agenda: {
command: function (language) {
return "node build-agenda.js " + language + " > _includes/agenda-" + language + ".html";
}
},
bower_install: {
command: "bower install"
},
jekyll_serve: {
command: "jekyll server --watch --config _config-local.yml"
},
npm_install: {
command: "npm install"
}
},
uglify: {
build: {
src: 'js/main.js',
dest: 'js/main.js'
}
},
clean: {
js: ["js/_bower.js"]
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-bower-concat');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-shell');
grunt.registerTask('build', ['jshint', 'shell:npm_install', 'shell:bower_install', 'bower_concat', 'concat', 'uglify', 'clean']);
grunt.registerTask('agenda', ['shell:agenda:es', 'shell:agenda:en']);
grunt.registerTask('run', ['build', 'shell:jekyll_serve']);
grunt.registerTask('default', ['run']);
};