-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vite-ssr build runs in development mode #199
Comments
I encountered the same problem as you with After some hacky debugging I could generate the correct production build by adding an additional argument for I.e. Change this: Lines 57 to 63 in 50461a4
to this:
Then running I also noticed that the mode isn't being sent through to the Line 24 in 50461a4
Line 70 in 50461a4
I'm not sure the impacts this hack might have so best if someone with knowledge on this project and vite have a look. For now I've gotten around it in my build process (docker) by adding:
...before I call the build command :D Very hacky I know and will break after an update! I'm not using it on a professional site, so not too bothered for now. Hopefully this will help get it fixed properly in the mean time. |
It's an unclear moment from the Vite side. You need to run the - "build": "rm -rf dist && vite-ssr build",
+ "build": "rm -rf dist && NODE_ENV=production vite-ssr build", |
Here is my package json:
When i do
npm run build
and then run my express server. My application runs in development mode.When i try to log "import.meta.env" it shows me that
mode
at the same time is"production"
andPROD
is false. How is this even possible?The text was updated successfully, but these errors were encountered: