Closed maziar-dandc closed 4 months ago
Did you try this?
import { defineConfig } from "vite";
import { djangoVitePlugin } from "django-vite-plugin";
export default defineConfig({
plugins: [djangoVitePlugin({
input: [
// entries
]
})],
server: {
host: "0.0.0.0",
}
});
Hi,
When using dockerized environments, we have to set
host: true
(aka 0.0.0.0 ipv4 / [::] ipv6) in vite config, to ensure docker container broadcasts their output, so it can be accessed by the host computer. This currently ends up making the.hotfile
containhttp://[::]:5173
which on linux works fine, but on windows it doesn't.I tried doing this on my own by using
config.define?._vite_custom_host
(found outdefine
doesn't like strings) andconfig.env?._vite_custom_host
(didn't work, couldn't debug further cause I'm noob), so would appreciate some pointers on how to go about it.