The problem i am facing is when i change somrthing in the html the page reloads
@sarfaraz1212 Yes. That’s what the Laravel Vite integration does: it refreshes the page when a Blade template is changed.
So what exactly is “not working”?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
The problem i am facing is when i change somrthing in the html the page reloads I am using these steps to install vite
1) npm install
2) npm install bootstrap
3) npm install sass
4) npm install jquery
My vite.config.js
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
plugins: [
laravel({
input: [
'resources/css/app.css',
'resources/sass/app.scss',
'resources/js/app.js'
],
refresh: true,
}),
],
resolve: {
alias: {
'@': '/resources',
'$': 'jQuery'
},
},
});
My package.js
{
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"axios": "^1.6.4",
"laravel-vite-plugin": "^1.0",
"vite": "^5.0"
},
"dependencies": {
"bootstrap": "^5.3.3",
"jquery": "^3.7.1",
"sass": "^1.77.6"
}
}
My blade
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
@vite(['resources/css/app.css', 'resources/sass/app.scss', 'resources/js/app.js'])
</head>
<body>
<h1>hshhhs</h1>
</body>
</html>
Please or to participate in this conversation.