-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
141 lines (105 loc) · 2.81 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-push-release');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-shell');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
compass: {
development: {
options: {
config: 'config.rb',
cssDir: 'css', // full fat
} // options
}, // development
production: {
options: {
config: 'config_prod.rb',
cssDir: 'css/dist', // minified
} // options
}, // production
}, //compass
jshint: {
beforeconcat: ['js/*.js']
}, // jshint
concat: {
dist: {
src: [
'js/libs/*.js',
'bower_components/bootstrap/js/*.js',
'js/scripts.js'
],
dest: 'js/dist/scripts.js',
}
},
uglify: {
build: {
src: 'js/dist/scripts.js',
dest: 'js/dist/scripts.min.js' // for some reason this places scripts.js before jquery
}
},
imagemin: {
dynamic: {
files: [{
expand: true,
cwd: 'images/',
src: ['**/*.{png,jpg,gif}'],
dest: 'images/'
}]
}
},
watch: {
//options: {
// livereload: true,
//}, //options
jekyllSources: {
files: [
// capture all except css - add your own
'*.html', '*.yml', 'assets/js/**.js',
'_posts/**', '_includes/**', 'courses/**', 'css/**',
],
tasks: 'shell:jekyll',
},
livereload: {
// Here we watch the files the sass task will compile to
// These files are sent to the live reload server after sass compiles to them
options: { livereload: true },
files: ['_site/**/*'],
},
// Add the following script to your HTML for livereload.
// <script src="http://localhost:35729/livereload.js"></script>
sass: {
files: ['sass/*.scss'],
tasks: ['compass']
}, // sass
scripts: {
files: ['js/*.js'],
tasks: ['concat', 'uglify', 'jshint'],
options: {
spawn: false,
}
}, // scripts
css: {
files: ['less/*.less'],
tasks: ['less'],
}, // css
images: {
files: ['images/**/*.{png,jpg,gif}'],
tasks: ['imagemin'],
options: {
spawn: false,
}
}, //images
}, //watch
shell: {
jekyll: {
command: 'rm -rf _site/*; jekyll build',
stdout: true
}
}
});
require('load-grunt-tasks')(grunt);
// Default Task is basically a rebuild
grunt.registerTask('default', ['concat', 'uglify', 'imagemin','compass', 'shell', 'watch']);
grunt.registerTask('dev', ['connect', 'watch']);
};