forked from jagthedrummer/canary-ember
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
72 lines (63 loc) · 1.65 KB
/
Copy pathGruntfile.js
File metadata and controls
72 lines (63 loc) · 1.65 KB
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
module.exports = function(grunt) {
grunt.initConfig({
aws: grunt.file.readJSON('aws-keys.json'),
s3: {
options: {
key: '<%= aws.AWSAccessKeyId %>',
secret: '<%= aws.AWSSecretKey %>',
bucket: '<%= aws.bucket %>',
access: 'public-read',
headers: {
// Two Year cache policy (1000 * 60 * 60 * 24 * 730)
"Cache-Control": "max-age=630720000, public",
"Expires": new Date(Date.now() + 63072000000).toUTCString()
}
},
prod: {
upload: [
{
src: 'dist/index.html',
dest: 'index.html',
options: {
headers: {
// 1 minute cache policy (1000 * 60)
"Cache-Control": "max-age=60000, public",
"Expires": new Date(Date.now() + 60000).toUTCString()
}
}
},
{
src: 'dist/assets/*',
dest: 'assets/'
},
{
src: 'dist/assets/bootstrap/*',
dest: 'assets/bootstrap'
},
{
src: 'dist/fonts/*',
dest: 'fonts/'
},
{
src: 'dist/fonts/bootstrap/*',
dest: 'fonts/bootstrap'
}
],
}
}, // end s3
hashres: {
prod: {
src: [
'dist/assets/app.js',
'dist/assets/vendor.css',
'dist/assets/app.css'
],
dest: 'dist/index.html',
}
} // end hashres
});
grunt.loadNpmTasks('grunt-s3');
grunt.loadNpmTasks('grunt-hashres');
// Default task(s).
grunt.registerTask('default', ['hashres','s3']);
};