Sammyjo20 / lasso

🐎 Lasso is a Laravel package created to make your deployments blazing fast.
MIT License
341 stars 16 forks source link

Vite environments (modes) and lasso #74

Closed ggolda closed 8 months ago

ggolda commented 1 year ago

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?

ggolda commented 1 year ago

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.

Sammyjo20 commented 9 months ago

Hey @ggolda I'm very sorry for the delay in this issue. Are you still having this issue or still need assistance?