@intrnl/esbuild-plugin-env
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

Expose environment variables to esbuild through process.env.

dotenv support

.env files are supported and the plugin will load these files from current working directory:

.env
.env.local
.env.[mode]
.env.[mode].local

Plugin defaults to development mode by default, configurable via NODE_ENV variable, or through mode in the plugin's configuration.

Filtering environemnt variables

By default, the plugin will inject all environment variables, but you can set a filter to only inject what you need.

env({
  // Only inject environment variables starting with `APP_`
  filter: (key, filename) => key.startsWith('APP_'),
});

Readme

Keywords

none

Package Sidebar

Install

npm i @intrnl/esbuild-plugin-env

Weekly Downloads

63

Version

0.1.3

License

MIT

Unpacked Size

4.42 kB

Total Files

6

Last publish

Collaborators

  • intrnl