# vue-svg-sprite-loader

> Webpack loader that takes a sprite svg and return a Vue component with the svg inline as template that can be imported

Latest version **1.2.1** (published 2018-11-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-svg-sprite-loader
pnpm add vue-svg-sprite-loader
yarn add vue-svg-sprite-loader
bun add vue-svg-sprite-loader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2018-11-29 |
| First published | 2017-08-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 10 |
| Author | monoguerin |
| Maintainers | monoguerin |
| Keywords | webpack, loader, vue, svg, sprite, inline, ie11, webpack-loader, svg-inline |

## Links

- npm: https://www.npmjs.com/package/vue-svg-sprite-loader
- Repository: https://github.com/monoguerin/vue-svg-sprite-loader
- Issues: https://github.com/monoguerin/vue-svg-sprite-loader/issues
- npm.io page: https://npm.io/package/vue-svg-sprite-loader

## Dependencies (3)

- [xml2js](https://npm.io/package/xml2js.md) ^0.4.17
- [loader-utils](https://npm.io/package/loader-utils.md) ^1.1.0
- [vue-template-compiler](https://npm.io/package/vue-template-compiler.md) ^2.4.2

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 1.2.1 (latest) — 2018-11-29
- 1.2.0 — 2018-04-02
- 1.1.0 — 2018-03-27
- 1.0.0 — 2017-08-11

## README

# vue-svg-sprite-loader

Webpack loader that takes a sprite svg and return a Vue component with the svg inline as template that can be imported.


## Installation

```
npm install --save-dev vue-svg-sprite-loader
```

## Configuration

```js
// webpack.config.js
{
  test: /\.svg$/,
  loader: 'vue-svg-sprite-loader',
  options: {
    // Removes svg title, default is false when not passing any options
    removeTitle: true
  }
}
```

## Example code

```html
<template>
  <div id="my-component">
    <h1>Be aware! <alert-icon></alert-icon></h1>
    <span>Hey next to this text should be an heart icon <heart-icon></heart-icon></span>
  </div>
</template>

<script>
import HeartIcon from './assets/iconsSprite.svg?love';
// render svg with a custom title
import AlertIcon from './assets/iconsSprite.svg?alert&title=some-custom-text';

export default {
  name: 'my-component',
  components: {
    'heart-icon': HeartIcon,
    'alert-icon': AlertIcon
  }
};
</script>
```
---
*The idea behind this was inspired by [vue-svg-loader](https://github.com/visualfanatic/vue-svg-loader)*.

---
_Source: https://npm.io/package/vue-svg-sprite-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
