monorepo-env
v0.0.5
Published
Automatically merge/share env files in a monorepo
Downloads
30
Readme
Monorepo Env
Automatically merge/share env files between monorepo root and project.
Features
- 🌍 Supports both Nuxt & Vite
- 📦 Zero config. Get started without any hassle
- ⚙️ Automatic Nuxt runtime env handling
- 🔗 Loads env from Nuxt layers
- 📃 Auto generated types for env variables
Nuxt Setup
Install the module to your Nuxt application with one command:
npx nuxi module add monorepo-env
That's it! You can now use monorepo-env in your Nuxt app ✨
Nuxt Runtime
Only NUXT_
prefixed variables are exposed to nuxt runtime (when enabled).
NUXT_KEY=my-private-key
NUXT_PUBLIC_KEY=my-public-key
The above env variables will become this in nuxt runtime:
$config.key
$config.public.key
Vite Setup
Add the dependency
pnpm add -D monorepo-env
Setup vite.config.ts
import { defineConfig } from 'vite'
import MonorepoENV from 'monorepo-env/vite'
defineConfig({
plugins: [
MonorepoENV()
]
})
Contribution
# Install dependencies
npm install
# Generate type stubs
npm run dev:prepare
# Develop with the playground
npm run dev
# Build the playground
npm run dev:build
# Run ESLint
npm run lint
# Run Vitest
npm run test
npm run test:watch
# Release new version
npm run release