1.6.2 • Published 10 months ago

vite-plugin-svgo v1.6.2

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

Vite Plugin SVGO

Vite plugin to load and optimize SVG files as raw string. For the optimization SVGO is used.

npm GitHub package.json version

// Lit-Element example
import {html, unsafeSVG} from 'lit';
import icon from '../assets/icon.svg';

html`
  <div>${unsafeSVG(icon)}</div>
`;

Install

npm install -D vite-plugin-svgo

Setup

import svg from 'vite-plugin-svgo'

export default defineConfig({
  plugins: [svg()]
})

SVGO Configuration

The plugin accepts custom optimize options.

// vite.config.ts
svg({
  multipass: true,
  plugins: [
    {
      name: 'preset-default',
      params: {
        overrides: {
          convertColors: {
            currentColor: true,
          },
        },
      },
    },
  ],
})
1.6.2

10 months ago

1.5.1

10 months ago

1.5.0

10 months ago

1.4.1

10 months ago

1.4.0

2 years ago

1.3.0

2 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago