Skip to content

使用import.meta.env获取环境变量提示类型“ImportMeta”上不存在属性“env”。 #9002

Closed Answered by nanfb
nanfb asked this question in Help/Questions
Discussion options

You must be logged in to vote

已经解决了,具体配置:
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/": ["./src/"]
},
"moduleResolution": "node",
"module": "esnext",
"types": ["vite/client"]
},
"include": ["./src//*.ts", "./src//.tsx", "./src/**/.vue", "./tests/**/*.ts"],
"exclude": ["node_modules"]
}
但是有点云里雾里的,有人可以解释一下最好

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by nanfb
Comment options

You must be logged in to vote
1 reply
@Liu-code3
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants