forked from Wilto/wilto-makes-food
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
117 lines (112 loc) · 1.97 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
/*global module:false,require:false*/
module.exports = function(grunt) {
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// Project configuration.
grunt.initConfig({
pkg: '<json:package.json>',
banner: '/*! recipe.is - v<%= pkg.version %> - */',
concat: {
options: {
banner: '<%= banner %>'
},
css: {
src: [
'_src/_assets/css/*'
],
dest: '_site/_assets/css/all.css'
}
},
copy: {
fonts: {
expand: true,
flatten: true,
src: ['_src/_assets/css/fonts/*'],
dest: '_site/_assets/css/fonts/',
},
media: {
expand: true,
flatten: true,
src: ['_src/_assets/media/*'],
dest: '_site/_assets/media/',
},
sw: {
expand: true,
flatten: true,
src: ['_src/service-worker.js'],
dest: '_site/',
},
},
watch: {
css: {
files: ['_src/_assets/css/**/*'],
tasks: 'watch-css'
},
js: {
files: ['_src/_assets/js/**/*'],
tasks: 'watch-js'
}
},
uglify: {
all: {
files: {
'_site/_assets/js/offline.min.js': ['_src/_assets/js/offline.js']
}
}
},
cssmin: {
options: {
banner: '<%= banner %>',
stripBanners: true
},
css: {
src: [
'<%= concat.css.dest %>'
],
dest: '<%= concat.css.dest %>'
}
},
responsive_images: {
options: {
newFilesOnly: true,
sizes: [{
name: '1',
width: 320,
},{
name: '2',
width: 450
},{
name: '3',
width: 640
},{
name: '4',
width: 820
},{
name: '5',
width: 1024
}]
},
files: {
expand: true,
cwd: '_src',
src: ['img/**.{jpg,gif,png}'],
dest: '_site'
}
}
});
// Default task.
grunt.registerTask('default', [
'copy',
'concat:css',
'uglify',
'responsive_images',
'cssmin'
]);
// NOTE these watch tasks try to run only relevant tasks per file save
grunt.registerTask('watch-css', [
'concat:css',
'cssmin'
]);
grunt.registerTask('watch-js', [
'uglify'
]);
};