@lewebsimple/nuxt3-svg
Simple SVG loader for Nuxt 3
1,222
2
| Install | |
|---|---|
npm install @lewebsimple/nuxt3-svg |
|
| Latest Version: | 0.2.2 |
| Vue: | 3 |
| License: | MIT |
| Last Updated: | Apr 27, 2023 |
| Links: | GitHub · npm |
Maintainer: pascalmartineau
Nuxt3 SVG
Simple SVG loader for Nuxt 3.
Features
- 📦 Import components from
.svgfiles
Quick Setup
- Add
@lewebsimple/nuxt3-svgdependency 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-svgto themodulessection 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
Related Packages
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.2.2 | ^3.0 | MIT | |
| 0.1.1 | ^3.0 | MIT |