# @ices/use-loader

> Find and add loader to webpack config

Latest version **2.0.0** (published 2022-08-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ices/use-loader
pnpm add @ices/use-loader
yarn add @ices/use-loader
bun add @ices/use-loader
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2022-08-15 |
| First published | 2021-02-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 42.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Stone |
| Maintainers | star2018 |
| Keywords | Webpack |

## Links

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

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

- 2.0.0 (latest) — 2022-08-15
- 1.4.0 — 2021-02-20
- 1.3.2 — 2021-02-20
- 1.3.1 — 2021-02-09
- 1.3.0 — 2021-02-09
- 1.2.1 — 2021-02-08
- 1.2.0 — 2021-02-05
- 1.1.2 — 2021-02-02
- 1.1.1 — 2021-02-02
- 1.1.0 — 2021-02-02
- 1.0.0 — 2021-02-01

## README

## @ices/use-loader

### Usage

```js
const { addLoaderBefore, addLoaderAfter, addLoader, findLoader } = require('@ices/use-loader')

// find file-loader
const matched = findLoader(webpackConfig, 'file-loader')

// add new loader config to the slibing position after the file-loader
addLoader(webpackConfig, 'file-loader', newRuleConfig, (index) => index + 1)

// add new loader config to the slibing position before the file-loader
addLoaderBefore(webpackConfig, 'file-loader', newRuleConfig)

// add new loader config to the slibing position after the file-loader
addLoaderAfter(webpackConfig, 'file-loader', newRuleConfig)

// use customize matcher
findLoader(webpackConfig, ({ name }) => name === 'file-loader')
```

### API

See dist/index.d.ts

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