Fix optimizeSvgs script (#160)
This commit is contained in:
committed by
GitHub
parent
cf13cef475
commit
fc2fac9ca4
@@ -14,7 +14,7 @@ function processSvg(svg) {
|
||||
return (
|
||||
optimize(svg)
|
||||
.then(setAttrs)
|
||||
.then(format)
|
||||
.then(optimizedSvg => format(optimizedSvg, { parser: 'babel' }))
|
||||
// remove semicolon inserted by prettier
|
||||
// because prettier thinks it's formatting JSX not HTML
|
||||
.then(svg => svg.replace(/;/g, ''))
|
||||
@@ -36,9 +36,7 @@ function optimize(svg) {
|
||||
],
|
||||
});
|
||||
|
||||
return new Promise(resolve => {
|
||||
svgo.optimize(svg, ({ data }) => resolve(data));
|
||||
});
|
||||
return svgo.optimize(svg).then(({ data }) => data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user