unplugin-typedotenv
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

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' })],
}


Package Sidebar

Install

npm i unplugin-typedotenv

Weekly Downloads

935

Version

0.2.2

License

Apache-2.0

Unpacked Size

21.7 kB

Total Files

21

Last publish

Collaborators

  • ssssota