When you make a change to the main.ts file, does that trigger a reload?
resources/js/src/main.ts
Hello,
I'm using Laravel 10.x with vue.js 3.2.x on my Ubuntu 22.x (not a sub-system) I'm trying to use vite to compile vuejs files, however the hot reload ain't working. THis is my vite.config.ts:
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import path from "path";
import laravel from "laravel-vite-plugin";
export default defineConfig({
plugins: [
laravel({
input: ["resources/js/src/main.ts"],
refresh: true,
}),
vue({
template: {
transformAssetUrls: {
includeAbsolute: false,
},
},
}),
],
resolve: {
alias: {
"@": path.resolve("./resources/js/src"),
},
},
optimizeDeps: {
include: ["quill"],
},
server: {
host: true,
cors: true,
}
});
When I do sail yarn dev I got this
VITE v3.2.7 ready in 298 ms
➜ Local: http://localhost:5173/
➜ Network: http://172.29.0.4:5173/
LARAVEL v10.42.0 plugin v0.7.8
➜ APP_URL: localhost
If I change the vite.config.ts the vite reloads, but if there is any other change in any .vue file, nothing happens What am I missing here?
docker-compose.yml
...
laravel.test:
build:
context: ./docker/8.2
dockerfile: Dockerfile
args:
WWWGROUP: '${WWWGROUP}'
image: sail-8.2/app
extra_hosts:
- 'host.docker.internal:host-gateway'
ports:
- '127.0.0.1:80:80'
- '${VITE_PORT:-5173}:${VITE_PORT:-5173}'
environment:
WWWUSER: '${WWWUSER}'
LARAVEL_SAIL: 1
XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
volumes:
- '.:/var/www/html'
networks:
- sail
depends_on:
- mysql
- redis
...
Please or to participate in this conversation.