@jackdbd/eleventy-plugin-ensure-env-vars

Eleventy plugin that checks environment variables before Eleventy builds your site.
Installation
npm install @jackdbd/eleventy-plugin-ensure-env-vars
Note: this library was tested on Node.js >=18. It might work on other Node.js versions though.
Usage
In your Eleventy config file:
import { ensureEnvVarsPlugin } from '@jackdbd/eleventy-plugin-ensure-env-vars'
export default function (eleventyConfig) {
eleventyConfig.addPlugin(ensureEnvVarsPlugin, {
envVars: ['DEBUG', 'NODE_ENV']
})
}
Configuration
Plugin options
envVars | undefined | Environment variables you want to be set when building your Eleventy site |
Troubleshooting
This plugin uses the debug library for logging.
You can control what's logged using the DEBUG
environment variable.
For example, if you set your environment variables in a .envrc
file, you can do:
export DEBUG=11ty-plugin:*
Dependencies
⚠️ Peer Dependencies
This package defines 2 peer dependencies.
@11ty/eleventy | >=2.0.0 or 3.0.0-alpha.6 |
debug | >=4.0.0 |
License
© 2022 - 2024 Giacomo Debidda // MIT License