Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

esbuild-external-global

noyobo603MIT1.0.1TypeScript support: included

[![npm package][npm-img]][npm-url] [![Build Status][build-img]][build-url] [![Downloads][downloads-img]][downloads-url] [![Issues][issues-img]][issues-url] [![Code Coverage][codecov-img]][codecov-url] [![Commitizen Friendly][commitizen-img]][commitizen-ur

readme

esbuild-external-global

npm package Build Status Downloads Issues Code Coverage Commitizen Friendly

This is a plugin for esbuild that allows you to define global variables that are not bundled by esbuild.

Installation

npm install esbuild-external-global

Usage

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

const externalReact = externalGlobal({
  react: "window.React",
});

esbuild
  .build(
    externalReact({
      entryPoints: [path.resolve(__dirname, "fixtures/react/index.tsx")],
      bundle: true,
      write: false,
    }),
  )
  .then(() => {
    console.log("Build succeeded");
  })
  .catch(() => {
    console.error("Build failed");
  });

Why not use plugins?

There is no difference in essence esbuild#337, except that plugins in esbuild cannot be called by pipes esbuild#1902. In order not to affect other existing plugins, we use aliases instead.

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

1.0.1 (2024-09-20)

1.0.0 (2024-09-05)

Features