forked from layui/layer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GruntFile.js
56 lines (49 loc) · 1.4 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
//压缩js - layer
uglify: {
options: {
expand: true
},
'layer.js': {
options: {
banner: '/*! layer-v<%= pkg.version %> <%= pkg.description %> License LGPL <%= pkg.homepage %> By <%= pkg.author %> */\n;'
},
src: './src/layer.js',
dest: './layer.js'
},
'layer.mobile.js': {
options: {
banner: '/*! layer mobile-v<%= pkg.mobile %> <%= pkg.description %>移动版 License LGPL <%= pkg.homepage %>mobile By <%= pkg.author %> */\n;'
},
src: './src/mobile/layer.js',
dest: './mobile/layer.js'
}
},
//压缩css
cssmin: {
options : {
compatibility : 'ie8', //设置兼容模式
noAdvanced : true //取消高级特性
}
,layer: {
files: [{
expand: true,
cwd: './src/skin',
src: ['*.css', '!*.min.css'],
dest: './skin'
}, {
expand: true,
cwd: './src/mobile/need',
src: ['*.css', '!*.min.css'],
dest: './mobile/need'
}]
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.registerTask('default', ['uglify', 'cssmin']);
};