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

babel-plugin-remove-ungap

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-remove-ungap

Remove @ungap ponyfills

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-remove-ungap

Travis CI Greenkeeper badge NPM Version NPM Downloads MIT

Remove @ungap ponyfills

Install babel-plugin-remove-ungap

npm i -D babel-plugin-remove-ungap

Usage

Add remove-ungap to your babelrc plugins if the ponyfills are not needed by your browser target. This could be due to only targeting modern browsers or because your project already polyfills the browser.

This plugin works with CJS and ES modules before bundling. It can be run by rollup-plugin-babel before import or require statements are altered.

exclude option

You can add the exclude option to block removal/processing of specific @ungap modules.

{
	plugins: [
		['remove-ungap', {
			exclude: [
				'@ungap/essential-map'
			]
		}]
	]
}

This config will cause any import of @ungap/essential-map to be preserved.

future option

Some @ungap polyfills are needed by most current browsers or did not exist when the current semver-major of this plugin was released. These are only processed if explicitly requested by the future option. For example:

{
	plugins: [
		['remove-ungap', {
			future: [
				'@ungap/from-entries'
			]
		}]
	]
}

Unknown modules are ignored.

Modules that are removed

ModuleTargetDeclares variable
@ungap/assignObject.assignYes
@ungap/array-iteratorArray.prototype[Symbol.iterator]Yes
@ungap/custom-eventCustomEvent
@ungap/essential-mapMap
@ungap/essential-setSet
@ungap/essential-symbolSymbol
@ungap/essential-weaksetWeakSet
@ungap/eventEvent
@ungap/event-targetEventTarget
@ungap/import-nodedocument.importNodeYes
@ungap/is-arrayArray.isArrayYes
@ungap/mapMap
@ungap/setSet
@ungap/template-literalval => valYes
@ungap/trimString.prototype.trimYes
@ungap/weakmapWeakMap
@ungap/weaksetWeakSet

@ungap/create-content is altered

@ungap/create-content is altered so that HAS_CONTENT is constant true. This allows minifiers to strip code that is not useed by modern browsers.

Modules that can be removed by the future option

ModuleTargetDeclares variable
@ungap/from-entriesObject.fromEntriesYes
@ungap/global-thisglobalThis
@ungap/promise-all-settledPromise.allSettledYes
@ungap/promise-anyPromise.anyYes
@ungap/template-tag-arguments(...args) => argsYes

Running tests

Tests are provided by xo and ava.

npm install
npm test

FAQs

Package last updated on 13 Jun 2019

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