postcss-svgo
Advanced tools
Comparing version 5.0.0-rc.2 to 5.0.0
@@ -6,2 +6,10 @@ # Change Log | ||
# [5.0.0](https://github.com/cssnano/cssnano/compare/postcss-svgo@5.0.0-rc.2...postcss-svgo@5.0.0) (2021-04-06) | ||
**Note:** Version bump only for package postcss-svgo | ||
# [5.0.0-rc.2](https://github.com/cssnano/cssnano/compare/postcss-svgo@5.0.0-rc.1...postcss-svgo@5.0.0-rc.2) (2021-03-15) | ||
@@ -8,0 +16,0 @@ |
@@ -12,4 +12,2 @@ "use strict"; | ||
var _isSvg = _interopRequireDefault(require("is-svg")); | ||
var _url = require("./lib/url"); | ||
@@ -23,3 +21,3 @@ | ||
function minify(decl, opts) { | ||
function minify(decl, opts, postcssResult) { | ||
const parsed = (0, _postcssValueParser.default)(decl.value); | ||
@@ -44,2 +42,6 @@ decl.value = parsed.walk(node => { | ||
} else { | ||
if (!dataURI.test(value)) { | ||
return; | ||
} | ||
let decodedUri; | ||
@@ -64,6 +66,2 @@ | ||
if (!(0, _isSvg.default)(svg)) { | ||
return; | ||
} | ||
let result; | ||
@@ -75,6 +73,8 @@ | ||
if (result.error) { | ||
throw new Error(`${PLUGIN}: ${result.error}`); | ||
decl.warn(postcssResult, `${result.error}`); | ||
return; | ||
} | ||
} catch (error) { | ||
throw new Error(`${PLUGIN}: ${error}`); | ||
decl.warn(postcssResult, `${error}`); | ||
return; | ||
} | ||
@@ -113,3 +113,5 @@ | ||
OnceExit(css) { | ||
OnceExit(css, { | ||
result | ||
}) { | ||
css.walkDecls(decl => { | ||
@@ -120,3 +122,3 @@ if (!dataURI.test(decl.value)) { | ||
minify(decl, opts); | ||
minify(decl, opts, result); | ||
}); | ||
@@ -123,0 +125,0 @@ } |
{ | ||
"name": "postcss-svgo", | ||
"version": "5.0.0-rc.2", | ||
"version": "5.0.0", | ||
"description": "Optimise inline SVG with PostCSS.", | ||
@@ -33,5 +33,4 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"is-svg": "^4.2.0", | ||
"postcss-value-parser": "^4.1.0", | ||
"svgo": "^2.2.2" | ||
"svgo": "^2.3.0" | ||
}, | ||
@@ -50,3 +49,3 @@ "bugs": { | ||
}, | ||
"gitHead": "5ba19ca54892f76ba6b2b698b4d88adcabd4451b" | ||
"gitHead": "0e2c3bf5835bafcdc8783bef66f730a24194c8f3" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
11052
3
110
0
- Removedis-svg@^4.2.0
- Removedfast-xml-parser@4.5.0(transitive)
- Removedis-svg@4.4.0(transitive)
- Removedstrnum@1.0.5(transitive)
Updatedsvgo@^2.3.0