vite-plugin-envtype-patch
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

vite-plugin-envtype-patch

Basic

gen dts file for import.meat.env;

Get all env values in configResolved hook, zero dependency.

/// <reference types="vite/client" /> 
interface ImportMetaEnv  {
  VITE_XXX: string
  // and so on
};

How to use

import { envTypePatch } from 'vite-plugin-envtype-patch'

{
  plugins: [
    envTypePatch({})
  ]
}

What's more

  • convert simple type for javascript value
import { TypeConvert } from 'vite-plugin-envtype-patch'

const typeConvert = new TypeConvert({ once: false })
typeConvert.genSimpleType({
  a: 100,
})

// call toString
const output = `${typeConvert}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.01latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.01
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i vite-plugin-envtype-patch

Weekly Downloads

1

Version

0.1.0

License

ISC

Unpacked Size

103 kB

Total Files

32

Last publish

Collaborators

  • pengbo-study