Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

laravel-mix-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

laravel-mix-polyfill

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

  • 3.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8K
decreased by-9.23%
Maintainers
1
Weekly downloads
 
Created
Source

NPM NPM NPM

Laravel Mix Polyfill

A Laravel Mix extension to include polyfills by using Babel, core-js, and 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:

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

NameTypeDefaultDescription
enabledbooleantrueShould polyfill be used.
useBuiltInsstring"usage"See here for detailed description. Possible values are:
"usage"
"entry"
false
targetsstring, boolean"defaults"Allows a target (browser) environment to be specified. This can either be:
• a browserslist-compatible query ("> 0.25%, not dead"),
• or false to transform all ECMAScript 2015+ code by default.

• Setting to false will also allow use of browserslist config sources (like .browserslistrc). See here and here for more information.

You can test string values on browserl.ist.
entryPointsstring, boolean"stable"Used when useBuiltIns is set to "entry". See below for possible values.
corejsnumber3The version of core-js to be used.
debugbooleanfalseOutputs the targets/plugins used to the console.

Entry Points

In core-js@3 the entry points were changed to allow for more flexibility.

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 of the now deprecated @babel/polyfill package which was used previously.

ValueDescription
"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).
falseDo not use a preset (you will need to add your own imports to the top of your entry point).

Keywords

FAQs

Package last updated on 27 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc