forked from bbc/Imager.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
48 lines (40 loc) · 1.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
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
// Store your Package file so you can reference its specific data whenever necessary
pkg: grunt.file.readJSON('package.json'),
imageDirectory: {
default: 'Demo - Grunt/Assets/Images/',
lazyload: 'Demo - Lazy Load/Assets/Images/'
},
// grunt responsive_images:dev:default
// grunt responsive_images:dev:lazyload
responsive_images: {
dev: {
options: {
sizes: [
{
width: 320,
},
{
width: 640
},
{
width: 1024
}
]
},
files: [{
expand: true,
cwd: '<%= imageDirectory[grunt.task.current.args[0]] %>',
src: ['*.{jpg,gif,png}'],
dest: '<%= imageDirectory[grunt.task.current.args[0]] %>Generated/'
}]
}
}
});
// Load NPM Tasks
grunt.loadNpmTasks('grunt-responsive-images');
// Default Task
grunt.registerTask('default', ['responsive_images:dev']);
};