File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 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
329329
330330var cleanCssCli = require(' clean-css-cli' );
331331
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+ }
336340 }
337341 }
342+ }
343+
344+ return cleanCssCli(process, function (cleanCss) {
345+ cleanCss.options.plugins.level1Value.push(customPlugin.level1.value);
338346});
339347` ` `
340348
You can’t perform that action at this time.
0 commit comments