-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
95 lines (89 loc) · 2.54 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
module.exports = function(grunt) {
// Project Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
less: {
development: {
options: {
paths: ["assets"]
},
files: {
"assets/css/theme.css": "assets/less/theme.less"
}
}
},
watch: {
styles: {
files: ['assets/less/**/*.less'],
tasks: ['less'],
options: {
nospawn: true
}
}
},
exec: {
run_server: {
cmd: "node serve.js"
},
build_index: {
cmd: "node render.js"
}
},
copy: {
resumejson: {
cwd: './',
src: [ 'resume.json' ],
dest: './',
expand: true
},
build: {
cwd: './assets/css',
src: [ 'theme.css' ],
dest: './build/assets/css',
expand: true
},
favicon: {
cwd: './',
src: [ 'favicon.ico' ],
dest: './build/',
expand: true
}
},
clean: {
build: {
src: [ 'build' ]
}
}
});
// Load the plugin that compiles less to css
grunt.loadNpmTasks('grunt-contrib-less');
// Load the plugin that watches file changes
grunt.loadNpmTasks('grunt-contrib-watch');
// Load the plugin to execute shell commands
grunt.loadNpmTasks('grunt-exec');
// Load the plugin to clean directories
grunt.loadNpmTasks('grunt-contrib-clean')
// Load the plugin to copy files
grunt.loadNpmTasks('grunt-contrib-copy');
// Default tasks
grunt.registerTask('default', ['exec']);
grunt.registerTask('build', [
/* Uncomment this item once you've created your own resume.json file
in the project root. This will use your own data to build your site.
*/
'copy:resumejson',
'clean',
'copy:build',
'less',
'exec:build_index' //,
/* Uncomment this item (and the comma above) if you add a favicon.ico
in the project root. You'll also need to uncomment the <link...> tag
at the top of resume.template.
*/
// 'copy:favicon'
]);
grunt.registerTask('serve', [
'build',
'exec:run_server'
])
}