Employee Spotlight
From Academia to Industry
Philipp Burckhardt recounts his journey from childhood computer fascinations, to building an e-learning platform at Carnegie Mellon University, and on to his current role at Socket.
@babel/plugin-external-helpers
Advanced tools
This plugin contains helper functions that’ll be placed at the top of the generated code
Package description
@babel/plugin-external-helpers is a Babel plugin that allows you to use Babel's helper functions from an external source rather than including them in every file. This can help reduce the overall bundle size by avoiding duplication of helper functions across multiple files.
Externalizing Babel Helpers
This configuration in your Babel setup will enable the use of external helpers. Instead of including Babel's helper functions in every file, they will be imported from an external source, reducing redundancy and potentially decreasing the bundle size.
module.exports = {
plugins: [
'@babel/plugin-external-helpers'
]
};
Using with a Custom Helper Library
You can specify a custom version of the helper library to use. This is useful if you have a specific version of Babel's helpers that you want to ensure compatibility with.
module.exports = {
plugins: [
['@babel/plugin-external-helpers', {
helperVersion: '7.0.0'
}]
]
};
babel-plugin-transform-runtime is another Babel plugin that helps to avoid duplication of helper functions by using a runtime library. Unlike @babel/plugin-external-helpers, which relies on externalizing helpers, transform-runtime uses a runtime library to achieve similar goals, often leading to smaller bundle sizes and avoiding polluting the global scope.
babel-plugin-external-helpers-2 is a fork of @babel/plugin-external-helpers with additional features and improvements. It aims to provide more flexibility and better performance compared to the original plugin.
Changelog
v7.22.5 (2023-06-08)
babel-preset-env
, babel-standalone
syntax-unicode-sets-regex
in standalone (@nicolo-ribaudo)babel-core
-transform-
when resolving missing plugins (@nicolo-ribaudo)Readme
This plugin contains helper functions that’ll be placed at the top of the generated code
See our website @babel/plugin-external-helpers for more information.
Using npm:
npm install --save-dev @babel/plugin-external-helpers
or using yarn:
yarn add @babel/plugin-external-helpers --dev
FAQs
This plugin contains helper functions that’ll be placed at the top of the generated code
The npm package @babel/plugin-external-helpers receives a total of 362,552 weekly downloads. As such, @babel/plugin-external-helpers popularity was classified as popular.
We found that @babel/plugin-external-helpers demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
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.
Employee Spotlight
Philipp Burckhardt recounts his journey from childhood computer fascinations, to building an e-learning platform at Carnegie Mellon University, and on to his current role at Socket.
Security News
Git dependencies in open source packages can introduce significant risks, including lack of version control, stability issues, dependency drift, and difficulty in auditing, making them potential targets for supply chain attacks.
Security News
Node.js has added experimental support for TypeScript, a move that highlights the growing importance of TypeScript in modern development.