Vite environments (modes) and lasso
ggolda opened this issue · comments
Vite supports multiple environments via specifying a flag --mode {stage}
during build command: https://vitejs.dev/guide/env-and-mode.html
The problem is when building on local with lasso vite for some reason ignores these .env.{stage}
files. In documentation it is said that:
In addition, environment variables that already exist when Vite is executed have the highest priority and will not be overwritten by .env files. For example, when running VITE_SOME_KEY=123 vite build.
Can it be related that Lasso runs vite and passes the same environment as laravel currently have which overrides variables from .env.{stage}
files?
The only way to fix it that I found is to override LASSO_BUILD_COMMAND
to ''
and run npm run build --mode {stage}
manually and just use lasso as a bundle publishing tool.