You shouldn't have anything in public/hot. Its being detected by vite that you are in a hot reload situation.
Laravel Vite Deploying to Host
Hi,
I've created a Laravel 9 application. Before Laravel 9 there was webpack.mix. And it was pretty easy to use and deploy. But I couldn't figure it out with Vite. In local there's nothing wrong. Everythings fine. But when it comes to deploying to host, something is wrong.
I ran the command "npm run build". It exported css and javascript to public/build folder. I've uploaded project to my shared hosting. Then I changed the url inside public/hot file to my website url. And then I tried to open the page but it cannot load the js and css files. I looked up to the page source, it tries to load;
<script type="module" src="https://test.xpdevil.com/@vite/client"></script>
<link rel="stylesheet" href="https://test.xpdevil.com/resources/css/admin.css" />
<script type="module" src="https://test.xpdevil.com/resources/js/app.js"></script>
But the css file is located in "public\build\assetsapp.9d89b38c.css". Why is it trying to reach /resources/ path?
And it gives me 404 on https://test.xpdevil.com/@vite/client. Why?
How can I properly deploy Vite into my shared hosting?
@Blitzkrieg this seems like the Windows bug? Are you running windows, if so which version of Vite do you have installed? You can check by running npm list vite.
For Windows, it's recommended to run vite@^3.0.4 since that fixed a bug with the CSS paths
Please or to participate in this conversation.