Skip to content

Commit e8a0315

Browse files
committed
convert options for svgo
1 parent d83b6e2 commit e8a0315

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

index.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ class SvgVue {
4848

4949
{
5050
loader: 'svgo-loader',
51-
options: Object.fromEntries(this.options.svgoSettings)
51+
options: {
52+
plugins: this._convertSvgoOptions(this.options.svgoSettings)
53+
}
5254
}
5355
]
5456
}
@@ -99,6 +101,23 @@ class SvgVue {
99101
return false;
100102
}
101103

104+
_convertSvgoOptions(options) {
105+
let converted = [];
106+
107+
options.forEach(option => {
108+
let settings = Object.keys(option);
109+
110+
settings.forEach(setting => {
111+
converted.push({
112+
name: setting,
113+
active: !! option
114+
});
115+
});
116+
});
117+
118+
return converted;
119+
}
120+
102121
}
103122

104123
mix.extend('svgVue', new SvgVue());

0 commit comments

Comments
 (0)