You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'd like to get access to vite's ìmport.meta.env.MODE variables and other env variables available in vite, but there seems that whenever I try to access them from config/index.ts it's not possible, and app throws this warning:
▲ [WARNING] "import.meta" is not available with the "cjs" output format and will be empty [empty-import-meta]
docs/.vitepress/config/index.ts:6:34:
6 │ console.log(process.env.NODE_ENV, import.meta.env.MODE)
╵ ~~~~~~~~~~~
You need to set the output format to "esm" for "import.meta" to work correctly.
I've been searching for some hints to help me solve this problem, but I've not found anything that really helps me. Any ideas?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'd like to get access to vite's
ìmport.meta.env.MODE
variables and other env variables available in vite, but there seems that whenever I try to access them fromconfig/index.ts
it's not possible, and app throws this warning:I've been searching for some hints to help me solve this problem, but I've not found anything that really helps me. Any ideas?
Regards
Beta Was this translation helpful? Give feedback.
All reactions