# @stefanprobst/svgo-loader

> Webpack loader to optimize svg images with [svgo](https://github.com/svg/svgo). Produces an svg string, so another loader like `file-loader` is needed to actually emit the transformed file.

Latest version **2.0.0** (published 2021-11-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install @stefanprobst/svgo-loader
pnpm add @stefanprobst/svgo-loader
yarn add @stefanprobst/svgo-loader
bun add @stefanprobst/svgo-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 | 2.0.0 |
| Published | 2021-11-01 |
| First published | 2020-09-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12.9 |
| Dependencies | 1 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | stefanprobst |

## Links

- npm: https://www.npmjs.com/package/@stefanprobst/svgo-loader
- Repository: https://github.com/stefanprobst/svgo-loader
- Homepage: https://github.com/stefanprobst/svgo-loader#readme
- Issues: https://github.com/stefanprobst/svgo-loader/issues
- npm.io page: https://npm.io/package/@stefanprobst/svgo-loader

## Dependencies (1)

- [svgo](https://npm.io/package/svgo.md) ^2.7.0

## Recent versions

- 2.0.0 (latest) — 2021-11-01
- 1.0.2 — 2020-11-08
- 1.0.1 — 2020-10-29
- 1.0.0 — 2020-09-21

## README

# svgo-loader

Webpack loader to optimize svg images with [svgo](https://github.com/svg/svgo). Produces an svg
string, so another loader like `file-loader` is needed to actually emit the transformed file.

## How to use

```js
// webpack.config.js

module.exports = {
  /* ... */
  module: {
    rules: [
      {
        test: /\.svg$/,
        use: [
          {
            loader: require.resolve('file-loader'),
          },
          {
            loader: require.resolve('@stefanprobst/svgo-loader'),
            options: {
              plugins: [
                {
                  name: 'preset-default',
                  params: {
                    overrides: {
                      removeViewBox: false,
                    },
                  },
                },
                { name: 'removeDimensions' },
              ],
            },
          },
        ],
      },
    ],
  },
}
```

## Options

Use the [`plugins` option](https://github.com/svg/svgo#configuration) to enable/disable and
configure [svgo plugins](https://github.com/svg/svgo#built-in-plugins). Note that providing a
`plugins` option overrides the default plugin preset. Use `preset-default` to include it.

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