esbuild-plugin-env
Define all environement variables for esbuild.
Replace process.env.SOMETHING
occurences with the corresponding value, even for browser builds.
Install
sh
npm i -D @chialab/esbuild-plugin-env
sh
yarn add -D @chialab/esbuild-plugin-env
sh
pnpm add -D @chialab/esbuild-plugin-env
Usage
ts
import envPlugin from '@chialab/esbuild-plugin-env';
import esbuild from 'esbuild';
await esbuild.build({
plugins: [envPlugin()],
});