1.0.7 ā€¢ Published 8 months ago

rollup-plugin-process-env v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

NPM downloads changelog license

rollup-plugin-process-env

šŸ£ A Rollup plugin which injects process.env variables into build.

stars watchers

Install

npm i rollup-plugin-process-env

Usage

Use prefix to inject environments from current process.env which starts with the prefix.

import env from 'rollup-plugin-process-env'

export default {
  plugins: [
    env('MY_PREFIX_'),
  ],
}

Use dotenv and dotenv-expand to get environments from .env and outer environments

import env from 'rollup-plugin-process-env'

require('dotenv-expand').expand(require('dotenv').config())

export default {
  plugins: [
    env('MY_PREFIX_'),
  ],
}

Filter environments by name

import env from 'rollup-plugin-process-env'

const envs = ['MY_ENV', 'ANOTHER_MY_NAME']

export default {
  plugins: [
    env(name => envs.includes(name)),
  ],
}

Provide an object to include it as process.env

import env from 'rollup-plugin-process-env'

export default {
  plugins: [
    env({ MY_ENV: 'true' }),
  ],
}

Issues

If you find a bug or have a suggestion, please file an issue on GitHub.

issues

1.0.7

8 months ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.0.0

1 year ago