# @dtinsight/auto-polyfills-webpack-plugin

> a webpack plugin for auto generate polyfills

Latest version **2.0.2** (published 2023-08-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @dtinsight/auto-polyfills-webpack-plugin
pnpm add @dtinsight/auto-polyfills-webpack-plugin
yarn add @dtinsight/auto-polyfills-webpack-plugin
bun add @dtinsight/auto-polyfills-webpack-plugin
```

## 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.2 |
| Published | 2023-08-23 |
| First published | 2023-08-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 18.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | xbrave |
| Maintainers | shuangxu, jiming2603, mortalyoung, liuxy0551, ziv, mumiao |

## Links

- npm: https://www.npmjs.com/package/@dtinsight/auto-polyfills-webpack-plugin
- npm.io page: https://npm.io/package/@dtinsight/auto-polyfills-webpack-plugin

## Dependencies (2)

- [terser](https://npm.io/package/terser.md) ^5.15.0
- [core-js-builder](https://npm.io/package/core-js-builder.md) ^3.24.1

## Recent versions

- 2.0.2 (latest) — 2023-08-23
- 2.0.1 — 2023-08-23
- 2.0.0 — 2023-08-21

## README

A webpack plugin for auto import polyfills using core-js custom build, you can combine it with esbuild-loader because esbuild-loader don't do auto polyfills

## Getting Started
1. Install as devDependencies:
``` bash
pnpm install @dtinsight/auto-polyfills-webpack-plugin -D
```

2. then add it into webpack plugins config:

```js
config.plugins.push(
      new AutoPolyfillsWebpackPlugin();
    );
```

and a minified file will be generated in project root (or custom with option cwd), then you should commit it for reused.

## Options

```ts
type IOpts = {
    cwd?: string; // cwd, default value is `process.cwd()`
    browserslistPath?: string; // default value is .browserslistrc in root directory
    hashType?: string; // crypto type, default value is md5
    customPrefix?: string; //custom polyfill prefix, default value is 'dt'
    excludeCoreJsModules?: string[]; //exclude core-js modules.
};
```

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