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
Vite supports using dotenv .env to pass some config into the application.
However, sometimes our config may be complex with various fields.
Now, unplugin-info supports pass some config with { meta: { ... } } to ~build/meta. But it does not support switch between different env (you must write some if-else or ? : code to support it) and modify vite.config.ts will cause server restart.
Clear and concise description of the problem
Vite supports using dotenv
.env
to pass some config into the application.However, sometimes our config may be complex with various fields.
Now, unplugin-info supports pass some config with
{ meta: { ... } }
to~build/meta
. But it does not support switch between different env (you must write someif-else
or? :
code to support it) and modifyvite.config.ts
will cause server restart.Suggested solution
Add another options
{ settings: '<config file>.{json|yml|...}' }
,{ settings: { dev: '...', production: '...', ... } }
Add another virtual module
~build/settings
to get the content of config file.For example:
Finally, in your app:
Additional context
No response
The text was updated successfully, but these errors were encountered: