@babel/build-external-helpers
A command line interface to build Babel external helpers.
Install
- npm
- Yarn
- pnpm
- Bun
npm install --save-dev @babel/build-external-helpers
yarn add --dev @babel/build-external-helpers
pnpm add --save-dev @babel/build-external-helpers
bun add --dev @babel/build-external-helpers
Usage
Build external helpers as a standalone script.
- npm
- Yarn
- pnpm
- Bun
npx @babel/build-external-helpers > external-helpers.js
yarn dlx @babel/build-external-helpers > external-helpers.js
pnpm dlx @babel/build-external-helpers > external-helpers.js
bun x @babel/build-external-helpers > external-helpers.js
Output Type
-t, --output-type, one of global (default), umd, var, and module.
The following example set outputType to umd.
- npm
- Yarn
- pnpm
- Bun
npx @babel/build-external-helpers --output-type umd > external-helpers.js
yarn dlx @babel/build-external-helpers --output-type umd > external-helpers.js
pnpm dlx @babel/build-external-helpers --output-type umd > external-helpers.js
bun x @babel/build-external-helpers --output-type umd > external-helpers.js
Allowlist
-l, --allow-list, comma-separated list of allowed helpers.
The following example generate the applyDecs2305 helper:
- npm
- Yarn
- pnpm
- Bun
npx @babel/build-external-helpers --allowlist applyDecs2305 > external-decorator-helpers.js
yarn dlx @babel/build-external-helpers --allowlist applyDecs2305 > external-decorator-helpers.js
pnpm dlx @babel/build-external-helpers --allowlist applyDecs2305 > external-decorator-helpers.js
bun x @babel/build-external-helpers --allowlist applyDecs2305 > external-decorator-helpers.js