Skip to content

Commit

Permalink
feat: modify dts default value
Browse files Browse the repository at this point in the history
  • Loading branch information
vtrbo committed Apr 28, 2024
1 parent 1392425 commit 45bccf0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion playground/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ VITE_VERSION=122
# 测试一下很多个空格
VITE_GE="0"
VITE_OBJECT="{ name: 'abc', value: '123' }"
VITE_ARRAY=123
VITE_STRING=abc
VITE_ABC=124534
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ interface ImportMetaEnv {
*/
readonly VITE_GE: string
readonly VITE_OBJECT: string
readonly VITE_ARRAY: number
readonly VITE_STRING: string
readonly VITE_ABC: number
}

interface ImportMeta {
Expand Down
4 changes: 3 additions & 1 deletion playground/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import VitePlugin from '../src'
export default defineConfig({
plugins: [
Inspect(),
VitePlugin(),
VitePlugin({
dts: 'types/auto-env.dts',
}),
],
})
2 changes: 1 addition & 1 deletion src/core/constant.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const VITE_PLUGIN_NAME: string = 'vite-plugin-meta-env-dts'
export const ENV_INCLUDES: string[] = ['.env.*']
export const ENV_PREFIX: string[] = ['VITE_']
export const ENV_DTS: string = 'auto-meta-env.d.ts'
export const ENV_DTS: string = 'types/auto-meta-env.d.ts'

0 comments on commit 45bccf0

Please sign in to comment.