danielstgt / laravel-mix-svg-vue

A Laravel Mix extension to inline SVG files with Vue.js and automatically optimize them with SVGO
MIT License
38 stars 9 forks source link

change_extendDefaultPlugins_to_preset_default #12

Open luckyzeno opened 2 years ago

luckyzeno commented 2 years ago

"extendDefaultPlugins" utility is deprecated. So I changed it to preset_default plugin

medeiroz commented 2 years ago

Is there a timeline for when this will be merged?

unre4l commented 2 years ago

@danielstgt Hi can you review and merge this pr? Would appreciate it! :slightly_smiling_face:

georgehanson commented 2 years ago

Until @danielstgt gets time to merge this in, I've created a fork which can be installed with NPM here @luckyzeno @medeiroz @unre4l

tonila commented 1 year ago

I swithced to @georgehanson package.

Problem was svg were not scaling correcty and the reason was, that svgo was removing svg viewBoxes. It seems, that svgo settings format has also changed.

I had to change svgoSettings from this:

.svgVue({
  ...
  svgoSettings: [
    { removeTitle: true },
    { removeViewBox: false },
    { removeDimensions: true }
  ]
});

to this

.svgVue({
  ...
  svgoSettings: {
    removeViewBox: false
  }
});