Overview
Nuxt-svgo is a module for Nuxt.js that allows you to load optimized SVG files as Vue components. It provides an easy way to use SVG assets in your Nuxt.js application and offers configuration options for customization.
Features
- Load optimized SVG files as Vue components
- Auto import icons from the assets/icons/ folder (configurable)
- Support for custom components instead of the built-in nuxt-icon component
- Option to disable global registration of icons
- Customize component prefix for SVG icons
- Works with both Vite and Webpack configurations
Installation
You can install nuxt-svgo using npm, yarn, or pnpm. Here are the installation steps:
- Using npm:
npm install nuxt-svgo
- Using yarn:
yarn add nuxt-svgo
- Using pnpm:
pnpm add nuxt-svgo
Summary
Nuxt-svgo is a useful Nuxt.js module that simplifies the integration of optimized SVG files as Vue components in your application. With features like auto import, custom components, and configuration options, it offers flexibility and ease of use. Whether you use Vite or Webpack, nuxt-svgo handles the necessary configurations for loading and optimizing SVG assets.