forked from shunyue1320/christmas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
48 lines (45 loc) · 1.51 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) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
app: {
files: {
'dist/js/app.js': [
'src/js/zepto-min.js',
'src/js/snowstorm.js',
'src/js/christmas.js'
]
}
}
},
cssmin: {
app: {
files: {
'dist/css/app.css': [
'src/css/christmas.css',
'src/css/animate.css'
]
}
}
},
imagemin: {
dynamic: { // Another target
files: [{
expand: true, // Enable dynamic expansion
cwd: 'src/images/', // Src matches are relative to this path
src: ['**/*.{jpg,png,gif}','!resources/*.*'], // Actual patterns to match
dest: 'dist/images/', // Destination path prefix
filter: "isFile"
}]
}
},
clean: {
"beforeBuild": ['dist'] //构建之前先删除旧版文件
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.registerTask('build', ['clean:beforeBuild', 'uglify','cssmin','imagemin']);
};