Skip to content

Latest commit

 

History

History
66 lines (49 loc) · 1.1 KB

README.md

File metadata and controls

66 lines (49 loc) · 1.1 KB

unplugin-typedotenv

typedotenv with unplugin.

You can generate TypeScript code from .env file. When you edit the .env file, the file is re-created.

read more

Setup

npm install --save-dev unplugin-typedotenv
Vite
// vite.config.ts
import typedotenv from 'unplugin-typedotenv/vite'
export default defineConfig({
  plugins: [typedotenv({ output: 'src/env.ts' })],
})


Rollup
// rollup.config.js
import typedotenv from 'unplugin-typedotenv/rollup'
export default {
  plugins: [typedotenv({ output: 'src/env.ts' })],
}


esbuild
// esbuild.config.js
import { build } from 'esbuild'
build({
  plugins: [require('unplugin-typedotenv/esbuild')({ output: 'src/env.ts' })],
})


Webpack
// webpack.config.js
module.exports = {
  /* ... */
  plugins: [require('unplugin-typedotenv/webpack')({ output: 'src/env.ts' })],
}