Development vs Build variables - using Vite

I have a SolidJS site working nicely. In the Vite development environment I have a variable called "server"...
const server = "http://localhost:3020"
const server = "http://localhost:3020"
but when I want to build it using "npm run build" this variable need to change...
const server = "http://192.168.1.15:3015"
const server = "http://192.168.1.15:3015"
Is there an easy way to set this up to happen automatically, so that I don't need to manually change this variable every time I want to build ryan
2 Replies
lxsmnsyc
lxsmnsyc8mo ago
Vite
Next Generation Frontend Tooling
davidapple
davidapple8mo ago
Thanks. I figured it out. This video helped me https://www.youtube.com/watch?v=jqCjflIGH1o