# @types/string-replace-webpack-plugin

> TypeScript definitions for string-replace-webpack-plugin

Latest version **0.1.6** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/string-replace-webpack-plugin
pnpm add @types/string-replace-webpack-plugin
yarn add @types/string-replace-webpack-plugin
bun add @types/string-replace-webpack-plugin
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2023-11-07 |
| First published | 2018-11-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51440 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/string-replace-webpack-plugin
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/string-replace-webpack-plugin
- npm.io page: https://npm.io/package/@types/string-replace-webpack-plugin

## Dependencies (1)

- [@types/webpack](https://npm.io/package/@types/webpack.md) ^4

## Recent versions

- 0.1.6 (latest) — 2023-11-07
- 0.1.3 (ts3.8) — 2021-12-16
- 0.1.2 (ts3.7) — 2021-03-25
- 0.1.1 (ts2.3) — 2019-02-13
- 0.1.5 — 2023-10-18
- 0.1.4 — 2023-09-25
- 0.1.0 — 2018-11-01

## README

# Installation
> `npm install --save @types/string-replace-webpack-plugin`

# Summary
This package contains type definitions for string-replace-webpack-plugin (https://github.com/jamesandersen/string-replace-webpack-plugin).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/string-replace-webpack-plugin.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/string-replace-webpack-plugin/index.d.ts)
````ts
import { Plugin, RuleSetUse } from "webpack";

export = StringReplacePlugin;

declare class StringReplacePlugin extends Plugin {
    static replace(
        options: StringReplacePlugin.Options,
        /**
         * loaders to follow the replacement
         */
        nextLoaders?: string,
    ): RuleSetUse;
    static replace(
        /**
         * loaders to apply prior to the replacement
         */
        prevLoaders: string,
        options: StringReplacePlugin.Options,
        /**
         * loaders to follow the replacement
         */
        nextLoaders?: string,
    ): RuleSetUse;
}

declare namespace StringReplacePlugin {
    interface Options {
        replacements: ReplacementItem[];
    }

    interface ReplacementItem {
        /**
         * a regex to match against the file contents
         */
        pattern: RegExp;
        /**
         * an ECMAScript string replacement function
         * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_function_as_a_parameter
         */
        replacement: (substring: string, ...args: any[]) => string;
    }
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: [@types/webpack](https://npmjs.com/package/@types/webpack)

# Credits
These definitions were written by [Rongjian Zhang](https://github.com/pd4d10).

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