# laravel-mix-polyfill

> A Laravel Mix extension to include polyfills by using Babel, core-js, and regenerator-runtime

Latest version **3.0.1** (published 2021-05-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install laravel-mix-polyfill
pnpm add laravel-mix-polyfill
yarn add laravel-mix-polyfill
bun add laravel-mix-polyfill
```

## 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 | 3.0.1 |
| Published | 2021-05-27 |
| First published | 2019-02-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 8.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 49 |
| Author | Scott Charlesworth |
| Maintainers | scottcharlesworth |
| Keywords | laravel, laravel mix, mix, polyfill, babel, webpack |

## Links

- npm: https://www.npmjs.com/package/laravel-mix-polyfill
- Repository: https://github.com/scottcharlesworth/laravel-mix-polyfill
- Homepage: https://github.com/scottcharlesworth/laravel-mix-polyfill#readme
- Issues: https://github.com/scottcharlesworth/laravel-mix-polyfill/issues
- npm.io page: https://npm.io/package/laravel-mix-polyfill

## Dependencies (2)

- [core-js](https://npm.io/package/core-js.md) ^2.6.9 || ^3.1.4
- [regenerator-runtime](https://npm.io/package/regenerator-runtime.md) ^0.13.2

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 3.0.1 (latest) — 2021-05-27
- 3.0.0 — 2021-01-05
- 2.0.0 — 2020-02-10
- 1.1.1 — 2020-01-08
- 1.1.0 — 2019-07-10
- 1.0.2 — 2019-04-10
- 1.0.1 — 2019-04-02
- 1.0.0 — 2019-02-08

## README

<p align="center">
<a href="https://www.npmjs.com/package/laravel-mix-polyfill"><img src="https://img.shields.io/npm/v/laravel-mix-polyfill.svg" alt="NPM"></a>
<a href="https://npmcharts.com/compare/laravel-mix-polyfill?minimal=true"><img src="https://img.shields.io/npm/dt/laravel-mix-polyfill.svg" alt="NPM"></a>
<a href="https://www.npmjs.com/package/laravel-mix-polyfill"><img src="https://img.shields.io/npm/l/laravel-mix-polyfill.svg" alt="NPM"></a>
</p>

# Laravel Mix Polyfill

A Laravel Mix extension to include polyfills by using [Babel](https://babeljs.io/), [core-js](https://github.com/zloirock/core-js), and [regenerator-runtime](https://github.com/facebook/regenerator/tree/master/packages/regenerator-runtime).

## Usage

First, install the extension.

```
npm install laravel-mix-polyfill --save-dev
```

or

```
yarn add laravel-mix-polyfill --dev
```

Then, require it within your `webpack.mix.js` file:

```js
let mix = require('laravel-mix');

require('laravel-mix-polyfill');

mix.js('resources/js/app.js', 'public/js')
   .sass('resources/sass/app.scss', 'public/css')
   .polyfill({
      enabled: true,
      useBuiltIns: "usage",
      targets: "firefox 50, IE 11"
   });
```

## Options

| Name        | Type                          | Default      | Description   |
| ----------- | ----------------------------- | ------------ | ------------- |
| enabled     | `boolean`                     | `true`       | Should polyfill be used. |
| useBuiltIns | `string`                      | `"usage"`    | [See here](https://babeljs.io/docs/en/babel-preset-env#usebuiltins) for detailed description. Possible values are: <br> &bull; `"usage"` <br> &bull; `"entry"` <br> &bull; `false`  |
| targets     | `string`, `boolean`           | `"defaults"` | Allows a target (browser) environment to be specified. This can either be: <br> &bull; a [browserslist-compatible](https://github.com/ai/browserslist) query (`"> 0.25%, not dead"`),<br> &bull; or `false` to transform all ECMAScript 2015+ code by default. <br><br> &bull; Setting to `false` will also allow use of browserslist config sources (like .browserslistrc). See [here](https://babeljs.io/docs/en/babel-preset-env#browserslist-integration) and [here](https://github.com/browserslist/browserslist#queries) for more information. <br><br> You can test string values on [browserl.ist](https://browserl.ist/). |
| entryPoints | `string`, `boolean`           | `"stable"`   | Used when `useBuiltIns` is set to `"entry"`. See below for possible values. |
| corejs      | `number`                      | `3`          | The version of core-js to be used. |
| debug       | `boolean`                     | `false`      | Outputs the targets/plugins used to the console. |

### Entry Points

In `core-js@3` the entry points were changed to [allow for more flexibility](https://github.com/zloirock/core-js/blob/master/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md#packages-entry-points-and-modules-names).

The following common presets have been included for ease, and will be inserted into the entry point for you automatically. `"stable"` has been set as the default [as it is a full equal](https://github.com/zloirock/core-js/blob/master/README.md#babelpolyfill) of the now deprecated `@babel/polyfill` package which was used previously.   

| Value          | Description   |
| -------------- | ------------- |
| **`"stable"`** | Polyfill only stable `core-js` features - ES and web standards. |
| `"all"`        | Polyfill all `core-js` features. |
| `"es"`         | Polyfill only stable ES features. |
| `"classic"`    | Imports copied from the latest `@babel/polyfill` package (before it was deprecated). |
| `false`        | Do not use a preset (you will need to add your own imports to the top of your entry point). |

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