yue1123 / vite-plugin-env-parse

Parse env string values to correct values, not all values are strings. And automatically generate ImportMetaEnv
MIT License
67 stars 4 forks source link

有bug,没有提示 #4

Closed Minori-ty closed 2 months ago

Minori-ty commented 2 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior: 安装之后配置,没有提示。使用的是pnpm

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

代码demo https://github.com/Minori-ty/template 的vue3-ts-sass文件夹

dev环境下配置了--mode development,并没有对.env.development文件夹生效,看了一下生成的env.d.ts,貌似只对.env起作用。但是依旧没有代码提示 image image image

yue1123 commented 2 months ago

tsconfig.json include 没有添加 env.d.ts 这个文件吧,加上再试试

{
  "include": ["env.d.ts"]
}
Minori-ty commented 2 months ago

tsconfig.json include 没有添加 env.d.ts 这个文件吧,加上再试试

{
  "include": ["env.d.ts"]
}

确实可以了。麻烦在文档补充一下把