Skip to content

Commit

Permalink
feat(icons): configure remove view box to false
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielduete committed Dec 17, 2024
1 parent 868d5ec commit 5f8bc8a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packages/icons/scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,20 @@ import { optimize } from 'svgo'

import { readSvg, readSvgDirectories, writeSvgFile } from './helpers.js'

function optimizeSvg(path: string, svg: string) {
const optimizedSvg = optimize(svg, { path })
function optimizeSvg(filePath: string, svg: string) {
const optimizedSvg = optimize(svg, {
path: filePath,
plugins: [
{
name: 'preset-default',
params: {
overrides: {
removeViewBox: false,
},
},
},
],
})

return optimizedSvg.data
}
Expand Down

0 comments on commit 5f8bc8a

Please sign in to comment.