This repository has been archived by the owner on Feb 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
161 lines (149 loc) · 4.35 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
module.exports = function(grunt) {
// load time-grunt and all grunt plugins found in the package.json
require('jit-grunt')(grunt);
// grunt config
grunt.initConfig({
// Copy bower files
copy: {
css: {
files: [
{
expand: true,
src: ['css/*.css'],
dest: '_site/css',
flatten: true
}
]
},
js: {
files: [
{
expand: true,
src: ['js/*.js'],
dest: '_site/js',
flatten: true
}
]
}
},
// Autoprefixer
autoprefixer: {
options: {
browsers: ['> 5%', 'last 2 versions', 'ie 11', 'ie 10', 'ie 9']
},
files: {
expand: true,
flatten: true,
src: 'css/*.css',
dest: 'css/'
}
},
// Uglify
uglify: {
options: {
soureMap: true
},
build: {
files: {
'js/scripts.js': [
'_scripts/lazy-embed.js'
]
}
}
},
// Sass
sass: {
options: {
'outputStyle': 'compressed'
},
main: {
files: [{
'css/style.css': '_scss/style.scss',
'css/ie.css': '_scss/ie.scss',
'css/timeline.css': '_scss/timeline.scss'
}]
}
},
// Browser Sync
browserSync: {
dev: {
bsFiles: {
src : [
"_site/*.*",
'_site/css/*.css',
'_site/js/*.js',
// Exclude for refresh so browser only refreshes once
'!_site/blog.xml',
'!_site/sitemap.xml'
]
},
options: {
port: 7669, // snow on phone keypad
open: true, // Opens site in your default browser, no need to remember the port
notify: false,
watchTask: true,
injectChanges: false,
server: {
baseDir: '_site'
}
}
}
},
// Shell commands
shell: {
jekyllBuild: {
command: 'bundle exec jekyll build --config _config.yml,_config.dev.yml'
}
},
// Watch files
watch: {
sass: {
files: [
// Including
'_scss/style.scss',
'_scss/**/*.scss'
],
tasks: ['sass', 'autoprefixer', 'copy:css'],
options: {
interrupt: false,
atBegin: true
}
},
uglify: {
files: [
// Including
'_scripts/*.js'
],
tasks: ['uglify', 'copy:js'], // Compile
options: {
interrupt: false,
atBegin: true
}
},
jekyll: {
files: [
// Including
'_data/*.*',
'_includes/*.*',
'_layouts/*.*',
'assets/*.*',
'images/*.*',
'media/*.*',
'_config.yml',
'_config.dev.yml',
'index.html',
'media.html',
'petition.html',
'highlights.html'
],
tasks: ['shell:jekyllBuild'],
options: {
interrupt: false,
atBegin: true
}
}
}
});
// The dev task will be used during development
grunt.registerTask('default', ['browserSync', 'watch']);
};