Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add readme section about integrating with Nuxt #137

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,19 @@ import IconWithoutOptimizer from './my-icon.svg?skipsvgo'
// <IconWithoutOptimizer />
```

### Use with Nuxt
Using `vite-svg-loader` with Nuxt is easy, we just need to set the following in `nuxt.config.js`.

```js
export default defineNuxtConfig({
vite: {
plugins: [svgLoader()]
}
})
```

Or you can use [`nuxt-svgo-loader`](https://github.com/Mini-ghost/nuxt-svgo-loader), which integrates `vite-svg-loader` and also uses Nuxt Devtools to enhance the development experience and help you find the SVG files you want in your project.

### Use with TypeScript
If you use the loader in a Typescript project, you'll need to reference the type definitions inside `vite-env.d.ts`:
```ts
Expand Down