Julien-R44 / vite-plugin-validate-env

✅ Vite plugin for validating your environment variables
MIT License
164 stars 6 forks source link

Support for environment variables that are exposed in the operating system's environment #16

Closed aminnairi closed 9 months ago

aminnairi commented 9 months ago

It would be great to have this plugin also work for environment variables that are loaded using the operating system.

One such use-case would be to use Docker and Docker Compose to create a monorepo and have all environment variables that are aggregated from a single .env file at the root of the monorepo to be loaded using Docker Compose.

services:
  node:
    env_file: .env

This will load all environment variables from a file, removing the need for a packages/www/.env file or packages/api/.env as well.

This plugin does not seem to work well when the .env file is absent, even though the environment variables are still there.

Is there a way around using this library? This would be great to have something similar to Nest.js custom configuration file.

Julien-R44 commented 9 months ago

Hey. Just tried with 1.0.0 and it works fine. Please feel free to re-open the issue if issue persist