forked from fuhrmanator/course-activity-planner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
36 lines (34 loc) · 1 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
// https://raw.githubusercontent.com/lanmomo/lanmomo-website/master/Gruntfile.js
// The following job busts the browser cache by adding the md5 of the file in index.html
module.exports = function(grunt) {
grunt.initConfig({
copy: {
pre: {
files: [
{expand: true, cwd: 'public/', src: ['**'], dest: 'tmp/'}
]
},
post: {
files: [
{expand: true, cwd: 'tmp/', src: ['**'], dest: 'static/'}
]
}
},
cacheBust: {
options: {
encoding: 'utf8',
algorithm: 'md5',
length: 8
},
assets: {
files: [{
src: ['tmp/index.html']
}]
}
}
});
require('load-grunt-tasks')(grunt);
grunt.registerTask('build', ['copy:pre',
'cacheBust',
'copy:post']);
};