0.0.4 • Published 1 month ago

monorepo-env v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

Monorepo Env

npm version npm downloads License Nuxt

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
  • 📃 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
0.0.4

1 month ago

0.0.3

1 month ago

0.0.2

1 month ago

0.0.1

1 month ago