Nov 14, 2022
2
Level 9
Newbie Question
I'm trying to do something like npm run watch where it detects changes but I can't seem to get it or maybe it doesn't work like that anymore. When I run npm run build everything works great but if I run npm run dev the page crashes with three console errors on Chrome.
http://localhost:5173/@vite/client net::ERR_CONNECTION_REFUSED
http://localhost:5173/resources/js/app.js net::ERR_CONNECTION_REFUSED
http://localhost:5173/resources/js/Pages/Test.vue net::ERR_CONNECTION_REFUSED
This is my vite config
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import vue from '@vitejs/plugin-vue';
export default defineConfig({
server: {
host: '0.0.0.0',
hmr: {
host: 'localhost'
}
},
plugins: [
laravel({
input: 'resources/js/app.js',
refresh: true,
}),
vue({
template: {
transformAssetUrls: {
base: null,
includeAbsolute: false,
},
},
}),
],
});
I don't think this is normal but I'm not sure. I don't really want to develop using npm run build because VueDevTools doesn't work this way.
Please or to participate in this conversation.