-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
81 lines (80 loc) · 1.94 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
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.registerTask('png', ['imagemin:png']);
grunt.registerTask('jpg', ['imagemin:jpg']);
// grunt.registerTask('imagemin', ['imagemin']);
grunt.initConfig({
watch: {
options: {
spawn: true,
maxListeners:200
},
watch_1: {
files: ['css/less/*.less'],
tasks: ['less:less_1']
}
},
less: {
less_1: {
options: {
paths: ['css/less/main.less']
},
files: {
'css/main.css': 'css/less/main.less'
}
}
},
imagemin: {
png: {
options: {
optimizationLevel: 7
},
files: [
{
// Set to true to enable the following options…
expand: true,
// cwd is 'current working directory'
cwd: 'images/src',
src: ['*.png'],
// Could also match cwd line above. i.e. project-directory/img/
dest: 'images/',
ext: '.png'
}
]
},
jpg: {
options: {
progressive: true
},
files: [
{
// Set to true to enable the following options…
expand: true,
// cwd is 'current working directory'
cwd: 'images/src',
src: ['*.jpg'],
// Could also match cwd. i.e. project-directory/img/
dest: 'images/',
ext: '.jpg'
}
]
},
gif: {
files: [
{
// Set to true to enable the following options…
expand: true,
// cwd is 'current working directory'
cwd: 'images/src',
src: ['*.gif'],
// Could also match cwd. i.e. project-directory/img/
dest: 'images/',
ext: '.gif'
}
]
}
}
});
};