# esbuild-plugin-external-global

> External modules as global variables

Latest version **1.0.1** (published 2021-05-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install esbuild-plugin-external-global
pnpm add esbuild-plugin-external-global
yarn add esbuild-plugin-external-global
bun add esbuild-plugin-external-global
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2021-05-14 |
| First published | 2021-05-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | yanm1ng |
| Maintainers | yanm1ng1121 |
| Keywords | esbuild, plugin, external |

## Links

- npm: https://www.npmjs.com/package/esbuild-plugin-external-global
- Repository: https://github.com/yanm1ng/esbuild-plugin-external-global
- Homepage: https://github.com/yanm1ng/esbuild-plugin-external-global#readme
- Issues: https://github.com/yanm1ng/esbuild-plugin-external-global/issues
- npm.io page: https://npm.io/package/esbuild-plugin-external-global

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2021-05-14

## README

# esbuild-plugin-external-global

External modules as global variables with `esbuild`.

## Install

```sh
yarn add -D esbuild-plugin-external-global
```

or

```sh
npm i -D esbuild-plugin-external-global
```

## Usage

Add to your esbuild plugins list:

```js
const esbuild = require("esbuild");
const { externalGlobalPlugin } = require("esbuild-plugin-external-global");

esbuild.build({
  ...
  plugins: [
    externalGlobalPlugin({
      'react': 'window.React',
      'react-dom': 'window.ReactDOM',
      'jQuery': '$'
    })
  ]
  ...
});
```

---
_Source: https://npm.io/package/esbuild-plugin-external-global · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
