@lewebsimple/nuxt3-svg
v0.2.2
Published
Simple SVG loader for Nuxt 3
Downloads
87
Readme
Nuxt3 SVG
Simple SVG loader for Nuxt 3.
Features
- 📦 Import components from
.svg
files
Quick Setup
- Add
@lewebsimple/nuxt3-svg
dependency to your project
# Using pnpm
pnpm add -D @lewebsimple/nuxt3-svg
# Using yarn
yarn add --dev @lewebsimple/nuxt3-svg
# Using npm
npm install --save-dev @lewebsimple/nuxt3-svg
- Add
@lewebsimple/nuxt3-svg
to themodules
section ofnuxt.config.ts
export default defineNuxtConfig({
modules: [
'@lewebsimple/nuxt3-svg'
]
})
- Add the following in
types/svg.d.ts
declare module "*.svg" {
import type { DefineComponent } from "vue";
const component: DefineComponent;
export default component;
}
That's it! You can now use Nuxt3 SVG in your Nuxt app ✨
Development
# Install dependencies
npm install
# Generate type stubs
npm run dev:prepare
# Develop with the playground
npm run dev
# Build the playground
npm run dev:build
# Run ESLint
npm run lint
# Run Vitest
npm run test
npm run test:watch
# Release new version
npm run release