diff --git a/packages/fes-plugin-icon/src/optimizeSvg.js b/packages/fes-plugin-icon/src/optimizeSvg.js index 545a6885..8673f230 100644 --- a/packages/fes-plugin-icon/src/optimizeSvg.js +++ b/packages/fes-plugin-icon/src/optimizeSvg.js @@ -4,18 +4,22 @@ import { optimize } from 'svgo'; const presetDefault = [ { - name: 'preset-default' + name: 'preset-default', + params: { + overrides: { + removeViewBox: false, + }, + }, }, 'cleanupListOfValues', { name: 'removeAttrs', params: { - attrs: '(fill|stroke|class)' - } - } + attrs: '(fill|stroke|class)', + }, + }, ]; - export default function optimizeSvg(files) { const optimizedSvgData = []; for (const filePath of files) { @@ -24,7 +28,7 @@ export default function optimizeSvg(files) { const svgData = optimize(data, { path: filePath, plugins: presetDefault }); optimizedSvgData.push({ fileName: basename(filePath), - ...svgData + ...svgData, }); } }