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