-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgruntfile.js
executable file
·85 lines (82 loc) · 1.74 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
module.exports = function (grunt) {
// Configure task(s)
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
global: {
files: {
"js/main.min.js": ["js/main.js"]
}
}
},
sass: {
global: {
options: {
style: 'compressed'
},
files: {
'css/main.css': '_sass/main.scss'
}
}
},
watch: {
js: {
files: ['js/*.js'],
tasks: ['uglify', 'shell:jekyllBuild']
},
css: {
files: ['_sass/*.scss'],
tasks: ['sass', 'shell:jekyllBuild']
},
site: {
files: ["index.html", "blog.html", "portfolio.html", "_layouts/*.html", "_posts/*.md", "_projects/*.md", "_includes/*.html", "_portfolio/*.html"],
tasks: ["shell:jekyllBuild"]
},
options : {
livereload : true
}
},
imagemin: {
files: {
'img/*.png': 'img/*.png',
'img/*.jpg': 'img/*.jpg',
'img/*.gif': 'img/*.gif'
}
},
jekyll: {
server: {
src: 'templates',
dest: 'dev',
server: true,
server_port: 8000,
auto: true
},
dev: {
src: 'templates',
dest: 'dev'
},
prod: {
src: 'templates',
dest: 'prod'
}
},
shell : {
jekyllBuild: {
command: "jekyll build --config _config-dev.yml"
},
jekyllServe: {
command: "jekyll serve --config _config-dev.yml"
}
}
});
// Load the plugins
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-jekyll');
grunt.loadNpmTasks('grunt-shell');
// Register task(s)
grunt.registerTask('default', ['uglify', 'sass', 'imagemin', 'shell:jekyllBuild', 'watch']);
grunt.registerTask("serve", ["shell:jekyllServe"]);
}