Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change_extendDefaultPlugins_to_preset_default #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

luckyzeno
Copy link

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

@medeiroz
Copy link

Is there a timeline for when this will be merged?

@unre4l
Copy link

unre4l commented May 5, 2022

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

@georgehanson
Copy link

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

@tonila
Copy link

tonila commented Jul 15, 2023

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
  }
});

Copy link

@tonila tonila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems, option definitions are not working as expected.

Docs say, that removeViewBox and removeTitle are enabled by default and removeDimensions is not.

So to remove title and dimensions and preserve viewBox, configuration that worked for me was:

{
    loader: 'svgo-loader',
    options: {
        plugins: [
            {
                name: 'preset-default',
                params: {
                    overrides: {
                        removeViewBox: false
                    }
                },
            },
            'removeDimensions'
        ],
    }
}

It seems this is not possible to configure with current implemention. Or is it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants