diff --git a/package-lock.json b/package-lock.json index 4c0fc37..283f93e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -556,9 +556,9 @@ } }, "clean-css": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz", - "integrity": "sha512-VcMWDN54ZN/DS+g58HYL5/n4Zrqe8vHJpGA8KdgUXFU4fuP/aHNw8eld9SyEIyabIMJX/0RaY/fplOo5hYLSFA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.0.1.tgz", + "integrity": "sha512-F1zAGOowUCg8yxT0O4UR+nmbMauf3YwbiUS60CPxpzJU7ulpamGzQomFrJSK4w/HqHtMmQKSHJUNue+dQQYQdg==", "requires": { "source-map": "~0.6.0" } diff --git a/package.json b/package.json index 9b6f90b..59cc968 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ }, "dependencies": { "chalk": "^4.1.0", - "clean-css": "~4.2.3", + "clean-css": "~5.0.1", "maxmin": "^3.0.0" }, "devDependencies": { diff --git a/tasks/cssmin.js b/tasks/cssmin.js index 5c37f4f..a86a3d4 100644 --- a/tasks/cssmin.js +++ b/tasks/cssmin.js @@ -29,7 +29,6 @@ module.exports = function (grunt) { this.files.forEach(function (file) { var options = this.options({ - rebase: false, report: 'min', sourceMap: false }); @@ -37,7 +36,9 @@ module.exports = function (grunt) { var availableFiles = getAvailableFiles(file.src); var compiled = ''; - options.rebaseTo = path.dirname(file.dest); + if (Boolean(options.rebase)) { + options.rebaseTo = path.dirname(file.dest); + } try { compiled = new CleanCSS(options).minify(availableFiles); diff --git a/test/expected/rebase.css b/test/expected/rebase.css index 173bce8..1e5e90b 100644 --- a/test/expected/rebase.css +++ b/test/expected/rebase.css @@ -1 +1 @@ -body{background:url(../test/fixtures/test.jpg)}/*# sourceMappingURL=rebase.css.map */ +body{background:url('../test/fixtures/test.jpg')}/*# sourceMappingURL=rebase.css.map */