vite-plugin-svg-inject

1.0.10 • Public • Published

⚙️ 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: [
    SVGInjectPlugin(),
  ],
})
  • Example

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

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

Package Sidebar

Install

npm i vite-plugin-svg-inject

Weekly Downloads

58

Version

1.0.10

License

MIT

Unpacked Size

3.42 kB

Total Files

5

Last publish

Collaborators

  • neki-development