@hyrious/vite-plugin-svga
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

vite-plugin-svga

A vite plugin to load svga file. Based on svga-loader.

Usage

npm i -D @hyrious/vite-plugin-svga

vite.config.ts

import svga from "@hyrious/vite-plugin-svga";

export default {
  plugins: [svga()],
};

main.ts

import { Player } from "svgaplayerweb";
import PinJump from "./assets/PinJump.svga";

const player = new Player("#app");

player.setVideoItem(PinJump);
player.startAnimation();

Recommend: shim.d.ts

declare module "*.svga" {
  const content: import("svgaplayerweb").VideoEntity;
  export default content;
}

License

MIT @ hyrious

Readme

Keywords

Package Sidebar

Install

npm i @hyrious/vite-plugin-svga

Weekly Downloads

51

Version

0.1.0

License

MIT

Unpacked Size

58.1 kB

Total Files

10

Last publish

Collaborators

  • hyrious