File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,10 +20,6 @@ const alerts = resolve('config/alerts');
2020const config = resolve ( 'config/svgs' ) ;
2121const global = resolve ( 'config/global' ) ;
2222
23- const plugins = {
24- plugins : Object . keys ( config . svgo ) . map ( ( p ) => { p : config . svgo [ p ] } )
25- } ;
26-
2723/**
2824 * Constants
2925 */
@@ -145,7 +141,10 @@ const svgo = async (file) => {
145141 try {
146142 let data = fs . readFileSync ( file , 'utf-8' ) ;
147143
148- let optimized = await optimize ( data , { path : file } ) ;
144+ let optimized = await optimize ( data , {
145+ path : file ,
146+ ...config . svgo
147+ } ) ;
149148
150149 return optimized . data ;
151150 } catch ( err ) {
Original file line number Diff line number Diff line change @@ -22,10 +22,21 @@ module.exports = {
2222 /**
2323 * Plugin options for SVGO
2424 *
25- * @source https://github.com/svg/svgo#what-it-can-do
25+ * @source https://github.com/svg/svgo#built-in-plugins
2626 */
27- svgo : {
28- convertPathData : false ,
27+ svgo : {
28+ plugins : [
29+ {
30+ name : 'preset-default' ,
31+ params : {
32+ overrides : {
33+ convertPathData : false ,
34+ inlineStyles : false ,
35+ cleanupIDs : false
36+ }
37+ }
38+ }
39+ ]
2940 } ,
3041
3142 /**
You can’t perform that action at this time.
0 commit comments