# svgstore-webpack-plugin

> Webpack plugin that stores svg images as symbols and emits or injects them into html

Latest version **0.1.0-beta.3** (published 2018-05-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install svgstore-webpack-plugin
pnpm add svgstore-webpack-plugin
yarn add svgstore-webpack-plugin
bun add svgstore-webpack-plugin
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0-beta.3 |
| Published | 2018-05-22 |
| First published | 2017-11-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 141.6 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Andrej Baran |
| Maintainers | andrejbaran |
| Keywords | webpack, plugin, svgstore |

## Links

- npm: https://www.npmjs.com/package/svgstore-webpack-plugin
- Repository: https://github.com/andrejbaran/svgstore-webpack-plugin
- Homepage: https://github.com/andrejbaran/svgstore-webpack-plugin#readme
- Issues: https://github.com/andrejbaran/svgstore-webpack-plugin/issues
- npm.io page: https://npm.io/package/svgstore-webpack-plugin

## Dependencies (4)

- [joi](https://npm.io/package/joi.md) ^13.0.1
- [glob](https://npm.io/package/glob.md) ^7.1.2
- [svgstore](https://npm.io/package/svgstore.md) ^2.0.2
- [glob-promise](https://npm.io/package/glob-promise.md) ^3.3.0

## 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

- 0.1.0-beta.3 (latest) — 2018-05-22
- 0.1.0-beta.2 — 2018-05-17
- 0.1.0-beta.1 — 2017-11-02

## README

## Info
A webpack plugin that uses [svgstore](https://github.com/svgstore/svgstore) package
to store specified svg images as symbols and makes them available for injection in
[html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin) as `htmlWebpackPlugin.files.svgstore`

### Reasoning / Alternatives
This plugin aims to do what [gulp-svgstore](https://github.com/w0rm/gulp-svgstore) and [grunt-svgstore](https://github.com/FWeinb/grunt-svgstore) does.
There are other webpack plugins that handle svg sprites in a more traditional webpack way and I encourage you to check them out first.

## Install

```shell
npm i svgstore-webpack-plugin
yarn add svgstore-webpack-plugin
```

## Usage

### Options
You can specify loader options the regular way in your webpack config:
```js
const SvgstoreWebpackPlugin = require("svgstore-webpack-plugin");

{
    ...
    pluginsmodule: [
        ...
        new SvgstoreWebpackPlugin({
            src: // glob specifing your svg icons/sprites,
            svgOptions: // optional options object for the svgstore package
            context: // root/context for the src glob
        })
    ]
    ...
}
```

## Contributing
All PRs are welcome! Note that [conventional changlog/standard version](https://github.com/conventional-changelog/standard-version) is used for versioning and commit messages.

## Roadmap
* Tests
* Ability to define several glob patterns in `src`

---
_Source: https://npm.io/package/svgstore-webpack-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
