-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
112 lines (109 loc) · 3.13 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
"use strict";
module.exports = function(grunt) {
grunt.initConfig({
s3: {
options: grunt.file.readJSON('s3.json'),
dev: {
// Files to be uploaded.
upload: [
{
src: 'public/*.html',
dest: '/',
gzip: true
},
{
src: 'public/*.ico',
dest: '/',
gzip: false
},
{
src: 'public/*.png',
dest: '/',
gzip: false
},
{
src: 'public/css/*.css',
dest: '/css/',
gzip: true
},
{
src: 'public/js/*',
dest: '/js/',
gzip: true
},
{
src: 'public/js/vendor/*',
dest: '/js/vendor/',
gzip: true
},
{
src: 'public/img/*',
dest: '/img/',
gzip: false,
headers: {
'Cache-Control': 'max-age=86400000'
}
},
{
src: 'public/img/vendor/*',
dest: '/img/vendor/',
gzip: false
},
{
src: 'public/img/sponsor/*',
dest: '/img/sponsor/',
gzip: false
},
{
src: 'public/img/map/*',
dest: '/img/map/',
gzip: false
},
{
src: 'public/fonts/*',
dest: '/fonts/',
gzip: true
}
],
}
},
recess: {
compile: {
src: ['public/css/main.less'],
dest: 'public/css/main.css',
options: {
compile: true
}
},
compress: {
src: ['public/css/main.less'],
dest: 'public/css/main.min.css',
options: {
compile: true,
compress: true
}
}
},
uglify: {
dev: {
options: {
compress: true
},
files: {
'public/js/main.min.js': ['public/js/vendor/jquery-1.10.1.js', 'public/js/main.js']
}
}
},
smushit: {
path: {
src: 'public/img'
}
}
});
// Default task.
grunt.registerTask('default', ['recess:compile', 'recess:compress', 'uglify']);
grunt.loadNpmTasks('grunt-s3');
grunt.loadNpmTasks('grunt-recess');
grunt.loadNpmTasks('grunt-smushit');
grunt.loadNpmTasks('grunt-contrib-uglify');
};