diff options
Diffstat (limited to 'node_modules/clean-css/lib/clean.js')
-rw-r--r-- | node_modules/clean-css/lib/clean.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/node_modules/clean-css/lib/clean.js b/node_modules/clean-css/lib/clean.js index 62308efec..8cdb4b793 100644 --- a/node_modules/clean-css/lib/clean.js +++ b/node_modules/clean-css/lib/clean.js @@ -46,6 +46,22 @@ var CleanCSS = module.exports = function CleanCSS(options) { }; }; + +// for compatibility with optimize-css-assets-webpack-plugin +CleanCSS.process = function (input, opts) { + var cleanCss; + var optsTo = opts.to; + + delete opts.to; + cleanCss = new CleanCSS(Object.assign({ returnPromise: true, rebaseTo: optsTo }, opts)); + + return cleanCss.minify(input) + .then(function(output) { + return { css: output.styles }; + }); +}; + + CleanCSS.prototype.minify = function (input, maybeSourceMap, maybeCallback) { var options = this.options; |