fix vite on external devices

This commit is contained in:
Luna D. 2024-06-10 21:17:06 +02:00
parent 885af36339
commit 90b4ee8915
No known key found for this signature in database
GPG key ID: 4B1C63448394F688
2 changed files with 6 additions and 2 deletions

View file

@ -28,6 +28,10 @@ export default defineConfig(({ command, mode }: ConfigEnv): UserConfig => {
return {
publicDir: 'static',
plugins: [],
server: {
host: '0.0.0.0',
port: 5173,
},
resolve: {
alias: {
common: path.resolve(__dirname, 'css/common/'),

View file

@ -24,8 +24,8 @@ html lang="en"
= csrf_meta_tag()
= vite_hmr? do
script type="module" src="http://localhost:5173/@vite/client"
script type="module" src="http://localhost:5173/js/app.ts"
script type="module" src="http://#{@conn.host}:5173/@vite/client"
script type="module" src="http://#{@conn.host}:5173/js/app.ts"
- else
script type="text/javascript" src=~p"/js/app.js" async="async"
= render PhilomenaWeb.LayoutView, "_opengraph.html", assigns