File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -74,13 +74,6 @@ module.exports = function (gulp, config) {
74
74
return gulp . src ( paths . src . less )
75
75
. pipe ( less ( ) )
76
76
. pipe ( lazyImageCSS ( { imagePath : lazyDir } ) )
77
- . pipe ( minifyCSS ( {
78
- safe : true ,
79
- reduceTransforms : false ,
80
- advanced : false ,
81
- compatibility : 'ie7' ,
82
- keepSpecialComments : 0
83
- } ) )
84
77
. pipe ( tmtsprite ( { margin : 4 } ) )
85
78
. pipe ( gulpif ( '*.png' , gulp . dest ( paths . dist . sprite ) , gulp . dest ( paths . dist . css ) ) ) ;
86
79
}
@@ -92,6 +85,19 @@ module.exports = function (gulp, config) {
92
85
. pipe ( gulp . dest ( './dist/css/' ) ) ;
93
86
}
94
87
88
+ //CSS 压缩
89
+ function miniCSS ( ) {
90
+ return gulp . src ( './dist/css/style-*.css' )
91
+ . pipe ( minifyCSS ( {
92
+ safe : true ,
93
+ reduceTransforms : false ,
94
+ advanced : false ,
95
+ compatibility : 'ie7' ,
96
+ keepSpecialComments : 0
97
+ } ) )
98
+ . pipe ( gulp . dest ( './dist/css/' ) ) ;
99
+ }
100
+
95
101
//图片压缩
96
102
function imageminImg ( ) {
97
103
return gulp . src ( paths . src . img )
@@ -184,6 +190,7 @@ module.exports = function (gulp, config) {
184
190
delDist ,
185
191
compileLess ,
186
192
compileAutoprefixer ,
193
+ miniCSS ,
187
194
gulp . parallel (
188
195
imageminImg ,
189
196
imageminSprite ,
You can’t perform that action at this time.
0 commit comments