Open brillout opened 6 days ago
Why my import.meta.env
is undefined?
@7iomka It's a Vite design limitation: import.meta.env
isn't defined in any config file, neither inside Vite's vite.config.js
file nor inside Vike's +config.js
files.
Because, in order to determine whether the production or development environment variables should be applied, the value of Vite's mode
setting needs to be known. And note that mode
can be defined inside vite.config.js
.
A possibility would be to stop using Vite's mode
implemention and have Vike implement its own mode
feature. (While we could make import.meta.env
work inside +config.js
and vike.config.js
files, I ain't sure we could make it work inside vite.config.js
files: to be researched.)
Description
env.public
..env.public
files?import.meta.env
support for config files?