1.2.0 • Published 4 months ago

vite-plugin-svg-inject v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

⚙️ Vite plugin SVG inject

Npm package version Small size

Inject SVG content into components

.

  • Install

npm i vite-plugin-svg-inject -D
  • Configure

import { defineConfig } from "vite";
import SVGInjectPlugin from "vite-plugin-svg-inject";

export default defineConfig({
  plugins: [
    // Target:
    // - "react" - If JSX library is React
    // - "other" (default) - For others libraries
    SVGInjectPlugin(target)
  ],
})
  • Example

import MyIcon from './images/icon.svg';

function MyComponent() {
  return (
    <div>
      <MyIcon width="32" fill="red" />
    </div>
  );
}
1.2.0

4 months ago

1.1.1

4 months ago

1.1.0

4 months ago

1.1.3

4 months ago

1.1.2

4 months ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

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