1.0.0 • Published 5 months ago

@luban-ui/vite-plugun-env-dts v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

Generate .d.ts for envs

Install

npm i -D vite @luban-ui/vite-plugun-env-dts

Create config file

import { defineConfig } from 'vite';
import envDts from '@luban-ui/vite-plugun-env-dts';

// vite.config.ts
export default defineConfig(() => {
  const root = __dirname;

  return {
    root,
    server: {
      host: '0.0.0.0',
      port: 5174
    },
    resolve: {
      alias: {
        '@': root
      }
    },
    plugins: [
      envDts({
        filename: 'custom-env.d.ts',
        name: 'CustomProcessEnv'
      })
    ]
    // ...others
  };
});