vite-plugin-lottie
v1.0.0
Published
A vite plugin for bundle lottie files.
Downloads
290
Maintainers
Readme
vite-plugin-lottie
A vite plugin for bundle lottie files.
Install
pnpm install vite-plugin-lottie -D
Usage
vite.config.ts
import { defineConfig } from 'vite'
import { lottie } from 'vite-plugin-lottie'
export default defineConfig({
plugins: [
lottie()
],
})
app.vue
<script setup>
import Lottie from 'lottie-web'
import animationData from './animation.json?lottie'
onMounted(() => {
Lottie.loadAnimation({
// ...
animationData,
})
})
</script>
Types
dts
/// <reference types="vite-plugin-lottie/client" />