0.2.2 • Published 2 years ago

@lewebsimple/nuxt3-svg v0.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Nuxt3 SVG

npm version npm downloads License Nuxt

Simple SVG loader for Nuxt 3.

Features

  • 📦  Import components from .svg files

Quick Setup

  1. 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
  1. Add @lewebsimple/nuxt3-svg to the modules section of nuxt.config.ts
export default defineNuxtConfig({
  modules: [
    '@lewebsimple/nuxt3-svg'
  ]
})
  1. 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
0.2.2

2 years ago

0.1.1

3 years ago