File tree Expand file tree Collapse file tree 6 files changed +24
-3
lines changed Expand file tree Collapse file tree 6 files changed +24
-3
lines changed Original file line number Diff line number Diff line change
1
+ from __future__ import unicode_literals
2
+
3
+ from pipeline .conf import settings
4
+ from pipeline .compressors import SubProcessCompressor
5
+
6
+
7
+ class CleanCSSCompressor (SubProcessCompressor ):
8
+
9
+ def compress_css (self , css ):
10
+ args = [settings .CLEANCSS_BINARY , settings .CLEANCSS_ARGUMENTS ]
11
+ return self .execute_command (args , css )
Original file line number Diff line number Diff line change 57
57
'CSSMIN_BINARY' : '/usr/bin/env cssmin' ,
58
58
'CSSMIN_ARGUMENTS' : '' ,
59
59
60
+ 'CLEANCSS_BINARY' : '/usr/bin/env cssclean' ,
61
+ 'CLEANCSS_ARGUMENTS' : '' ,
62
+
60
63
'COFFEE_SCRIPT_BINARY' : '/usr/bin/env coffee' ,
61
64
'COFFEE_SCRIPT_ARGUMENTS' : '' ,
62
65
Original file line number Diff line number Diff line change
1
+ .concat {display : none}.concatenate {display : block}
Original file line number Diff line number Diff line change 13
13
"dependencies" : {
14
14
"babel-cli" : " ^6.4.5" ,
15
15
"babel-preset-es2015" : " ^6.3.13" ,
16
+ "clean-css" : " ^3.4.9" ,
16
17
"coffee-script" : " ^1.10.0" ,
18
+ "cssmin" : " ^0.4.3" ,
19
+ "google-closure-compiler" : " ^20151216.2.0" ,
17
20
"less" : " ^2.5.3" ,
18
21
"livescript" : " ^1.4.0" ,
19
22
"node-sass" : " ^3.4.2" ,
20
23
"stylus" : " ^0.53.0" ,
21
- "cssmin" : " ^0.4.3" ,
22
- "google-closure-compiler" : " ^20151216.2.0" ,
23
24
"uglify-js" : " ^2.6.1" ,
24
25
"yuglify" : " ^0.1.4" ,
25
26
"yuicompressor" : " ^2.4.8"
Original file line number Diff line number Diff line change @@ -149,6 +149,7 @@ def node_exe_path(command):
149
149
'YUGLIFY_BINARY' : node_exe_path ('yuglify' ),
150
150
'UGLIFYJS_BINARY' : node_exe_path ('uglifyjs' ),
151
151
'CSSMIN_BINARY' : node_exe_path ('cssmin' ),
152
+ 'CLEANCSS_BINARY' : node_exe_path ('cleancss' ),
152
153
})
153
154
154
155
if HAS_NODE and HAS_JAVA :
Original file line number Diff line number Diff line change @@ -250,6 +250,11 @@ def test_cssmin(self):
250
250
self ._test_compressor ('pipeline.compressors.cssmin.CSSMinCompressor' ,
251
251
'css' , 'pipeline/compressors/cssmin.css' )
252
252
253
+ @skipUnless (settings .HAS_NODE , "requires node" )
254
+ def test_cssclean (self ):
255
+ self ._test_compressor ('pipeline.compressors.cleancss.CleanCSSCompressor' ,
256
+ 'css' , 'pipeline/compressors/cleancss.css' )
257
+
253
258
@skipUnless (settings .HAS_NODE , "requires node" )
254
259
@skipUnless (settings .HAS_JAVA , "requires java" )
255
260
def test_closure (self ):
@@ -273,4 +278,3 @@ def test_csstidy(self):
273
278
self ._test_compressor ('pipeline.compressors.csstidy.CSSTidyCompressor' ,
274
279
'css' , 'pipeline/compressors/csstidy.css' )
275
280
276
-
You can’t perform that action at this time.
0 commit comments