Gruntfilenew.js
7.15 KB
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
/**
* 打包配置
*
*/
'use strict';
module.exports = function( grunt ) {
grunt.file.defaultEncoding = 'utf8';
grunt.initConfig({
pkg: grunt.file.readJSON( 'package.json' ),
build: {
//src: 'src/<%= pkg.name %>.js',
//dest: 'dist/<%= pkg.name %>.min.js'
},
// css 合并
css_combo: {
//文件头部输出信息
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
//美化代码
beautify: true
},
css: {
files:{
// 'css/dist/wap-app-download.css':['css/style/wap-app-download.css'],
// 'css/dist/pnr1-2.css':['css/style/pnr1-2.css'],
// //首页
// 'css/dist/index.css':['css/style/index.css'],
// //列表页
// 'css/dist/list.css':['css/style/list.css'],
// 'css/dist/shop-list.css':['css/style/shop-list.css'],
// 'css/dist/shoppingList.css':['css/style/shoppingList.css'],
// 'css/dist/shopping.list.css':['css/style/shopping.list.css'],
// // 详细页
// 'css/dist/details.css':['css/style/details.css'],
// 'css/dist/shop-details.css':['css/style/shop-details.css'],
// 'css/dist/user-reg.css':['css/style/user-reg.css'],
// //指数
// 'css/dist/index-list.css':['css/style/index-list.css'],
// 'css/dist/index-details.css':['css/style/index-details.css'],
// //资质荣誉页面
// 'css/dist/creditManage.css':['css/style/creditManage.css'],
// 'css/dist/creditUpload.css':['css/style/creditUpload.css'],
// 'css/dist/creditDetail.css':['css/style/creditDetail.css'],
// 'css/dist/creditshop.css':['css/style/creditshop.css'],
// //评价页面
// 'css/dist/evaluate.css':['css/style/evaluate.css'],
// 'css/dist/manageEvaluate.css':['css/style/manageEvaluate.css'],
// //商品发布
// 'css/dist/release-of-goods.css':['css/style/release-of-goods.css'],
// 'css/dist/user-release-of-goods.css':['css/style/user-release-of-goods.css'],
// //采购中心
// 'css/dist/procurementCenter.css':['css/style/procurementCenter.css'],
// //销售中心
// 'css/dist/marketApplication.css':['css/style/marketApplication.css'],
// 'css/dist/marketPrepare.css':['css/style/marketPrepare.css'],
// 'css/dist/marketQuote.css':['css/style/marketQuote.css'],
// 'css/dist/memberSellList.css':['css/style/memberSellList.css'],
// 'css/dist/memberSellDetail.css':['css/style/memberSellDetail.css'],
// 'css/dist/refundList.css':['css/style/refundList.css'],
// 'css/dist/refundDetail.css':['css/style/refundDetail.css'],
// //商机信息
// //商机首页
// 'css/dist/tradeIndex.css':['css/style/tradeIndex.css'],
// //商机列表
// 'css/dist/tradeList.css':['css/style/tradeList.css'],
// //商机详情
// 'css/dist/tradeDetails.css':['css/style/tradeDetails.css'],
// //供应
// //供应管理
// 'css/dist/supplyManage.css':['css/style/supplyManage.css'],
// //供应详情
// 'css/dist/supplyDetail.css':['css/style/supplyDetail.css'],
// //发布供应信息
// 'css/dist/supplyPublish.css':['css/style/supplyPublish.css'],
// //询价详情
// 'css/dist/supplyDetailEnquiry.css':['css/style/supplyDetailEnquiry.css'],
// //账户中心
// //用户资料
// 'css/dist/accountManage.css':['css/style/accountManage.css'],
// 'css/dist/user_authen_form.css':['css/style/user_authen_form.css'],
// 'css/dist/security.css':['css/style/security.css'],
// //旧版本用户资料
// 'css/dist/accountManage.old.css':['css/style/accountManage.old.css'],
// // 提交订单
// 'css/dist/orderSubmit.css':['css/style/orderSubmit.css'],
// 'css/dist/order_confirm.css':['css/style/order_confirm.css'],
// 'css/dist/order_confirm_success.css':['css/style/order_confirm_success.css'],
// // 地利优选
// 'css/dist/diliFine.css':['css/style/diliFine.css'],
// 'css/dist/credit_manage.css':['css/style/credit_manage.css'],
// 'css/dist/store_ready.css':['css/style/store_ready.css'],
// 'css/dist/protocolDemo.css':['css/style/protocolDemo.css'],
// 'newstyle/mini/module.css':['css/module.css'],
// 'newstyle/mini/myNongFeng.css':['newstyle/myNongFeng.css'],
// 'newstyle/mini/manageProduct.css':['newstyle/manageProduct.css'],
// 'newstyle/mini/myPicture.css':['newstyle/myPicture.css'],
// 'newstyle/mini/addresses_list.css':['newstyle/addresses_list.css'],
// 'newstyle/mini/buyer_refund_list.css':['newstyle/buyer_refund_list.css'],
// 'newstyle/mini/buyer_refund_submit.css':['newstyle/buyer_refund_submit.css'],
// 'newstyle/mini/seller_refund_list.css':['newstyle/seller_refund_list.css'],
// 'newstyle/mini/seller_refund_submit.css':['newstyle/seller_refund_submit.css'],
// 'newstyle/mini/recommend_goods.css':['newstyle/recommend_goods.css'],
// 'newstyle/mini/release-goods.css':['newstyle/release-goods.css'],
// 'newstyle/mini/user_common.css':['newstyle/user_common.css'],
// 'newstyle/mini/print.css':['newstyle/print.css'],
}
}
},
// css 压缩
cssmin:{
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
compatibility : 'ie8', //设置兼容模式
noAdvanced : true //取消高级特性
},
// css: {
// files:{
// //首页
// 'css/dist/index.css':['css/dist/index.css'],
// //充值
// // 'css/dist/recharge.css':['css/dist/recharge.css'],
// }
// }
minify: {
// expand: true,
// cwd: 'css/dist/',
// src: ['*.css', '!*.min.css'],
// dest: 'css/dist/',
// ext: '.css'
// expand: true,
// cwd: 'newstyle/mini/',
// src: ['*.css', '!*.min.css'],
// dest: 'newstyle/mini/',
// ext: '.css'
expand: true,
cwd: 'oldCommon/css0.5/',
src: ['*.css', '!*.min.css'],
dest: 'oldCommon/mini/',
ext: '.css'
}
},
// js压缩
uglify: {
//文件头部输出信息
options: {
mangle: false,
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
files: [{
expand: true,
cwd: 'headder-footer',
src: '**/*.js',
dest: 'headder-footer/mini'
}]
}
},
imagemin: {
compress: {
files: [{
expand: true,
cwd: 'images/',
src: ['**/*.{png,jpg,gif}'],
dest: 'build/<%= pkg.version %>/images'
}]
}
}
});
// 合并nn
grunt.loadNpmTasks( 'grunt-contrib-concat' );
// 压缩
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
//css 合并
grunt.loadNpmTasks('grunt-css-combo');
grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
grunt.loadNpmTasks( 'grunt-contrib-imagemin' );
grunt.registerTask( 'default', [
'css_combo',
'cssmin',
'uglify'
] );
};