File tree 1 file changed +12
-4
lines changed
1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -329,12 +329,20 @@ clean-css-cli can also be used as a module in a way of enhancing its functionali
329
329
330
330
var cleanCssCli = require(' clean-css-cli' );
331
331
332
- return cleanCssCli(process, function beforeMinify(cleanCss) {
333
- cleanCss.options.level[' 1' ].transform = function (propertyName, propertyValue) {
334
- if (propertyName == ' background-image' && propertyValue.indexOf(' ../valid/path/to' ) == -1) {
335
- return propertyValue.replace(' url(' , ' url(../valid/path/to/' );
332
+ var customPlugin = {
333
+ level1: {
334
+ value: function (propertyName, propertyValue, options) {
335
+ if (propertyName == ' background-image' && propertyValue.indexOf(' ../valid/path/to' ) == -1) {
336
+ return propertyValue.replace(' url(' , ' url(../valid/path/to/' );
337
+ } else {
338
+ return propertyValue;
339
+ }
336
340
}
337
341
}
342
+ }
343
+
344
+ return cleanCssCli(process, function (cleanCss) {
345
+ cleanCss.options.plugins.level1Value.push(customPlugin.level1.value);
338
346
});
339
347
` ` `
340
348
You can’t perform that action at this time.
0 commit comments