If you're running npm run dev the @vite directive it point to http://127.0.0.1:5176/@vite.
If you want to point to the build files, you need to stop the npm run dev and (maybe) delete the hot file in the public directory.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am migrating from Laravel Mix to Vite, but I have encountered a problem.
This is my vite.config:
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [
vue(),
laravel([
'resources/css/app.css',
'resources/js/app.js',
]),
],
});
app.js
import './bootstrap';
import '../css/app.css';
app.css
@config "../../tailwind.config.js";
@tailwind base;
@tailwind components;
@tailwind utilities;
when I use the npm run build command. he generates the files for me in: public\build\assets And that's fine, however, the files are called:
public/build/manifest.json 0.39 kB │ gzip: 0.15 kB
public/build/assets/app-5229ad1e.css 155.98 kB │ gzip: 22.17 kB
public/build/assets/app-75742ecd.js 29.03 kB │ gzip: 11.59 kB
In my blade I have:
@vite(['build/app.js', 'build/app.css'])
Which is then interpreted to me as:
<script type="module" src="http://127.0.0.1:5176/@vite/client" data-navigate-track="reload"></script>
<link rel="stylesheet" href="http://127.0.0.1:5176/resources/css/app.css" data-navigate-track="reload" />
How do I get the resources interpreted with the correct name?
Please or to participate in this conversation.