Skip to content



Terminal window
npm add @dotenv-run/rollup --save-dev


Create a rollup.config.js configuration file and import the plugin:

import env from '@dotenv-run/rollup';
export default {
input: 'src/index.js',
output: {
file: 'dist/index.js',
plugins: [
env({ prefix: 'API', verbose: true, root: '../../..' })

Then call rollup either via the CLI or the API.

The list of options is the same as the ones supported by @dotenv-run/core. Please refer to the API section for more details.