esbuild-resolve-alias
v1.0.0
Published
[![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
Downloads
5
Readme
esbuild-external-global
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.