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

[Docs] Wrong example config, e.g. removeViewBox option will not work #54

Closed
madebyfabian opened this issue Sep 8, 2022 · 0 comments · Fixed by #58
Closed

[Docs] Wrong example config, e.g. removeViewBox option will not work #54

madebyfabian opened this issue Sep 8, 2022 · 0 comments · Fixed by #58

Comments

@madebyfabian
Copy link

Hi there! Thanks for your work on this plugin.

I discovered that the current config docs at here https://github.com/cpsoinos/nuxt-svgo#configuration are pointing out that you can do something like:

export default defineNuxtConfig({
  modules: ['nuxt-svgo'],
  svgo: {
    svgoConfig: {
      multipass: true,
      removeViewBox: false,
      plugins: [
        {
          name: 'preset-default',
          params: {
            overrides: {
              // customize default plugin options
              inlineStyles: {
                onlyMatchedOnce: false
              },

              // or disable plugins
              removeDoctype: false
            }
          }
        }
      ]
    }
  }
})

with svgo.svgoConfig,removeViewBox. But this setting will not work, and it will still remove the viewBox. This syntax though works for me:

export default defineNuxtConfig({
  modules: ['nuxt-svgo'],
  svgo: {
    svgoConfig: {
      multipass: true,
      removeViewBox: false,
      plugins: [
        {
          name: 'preset-default',
          params: {
            overrides: {
              // ...
              removeViewBox: false,
            }
          }
        }
      ]
    }
  }
})

See here: jpkleemans/vite-svg-loader#56 (comment)

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 a pull request may close this issue.

1 participant