1.0.1 • Published 3 years ago

esbuild-plugin-external-global v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

esbuild-plugin-external-global

External modules as global variables with esbuild.

Install

yarn add -D esbuild-plugin-external-global

or

npm i -D esbuild-plugin-external-global

Usage

Add to your esbuild plugins list:

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

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