DEV Community

Discussion on: Using Vite with Inertia — Laravel, Vue & Tailwind

fkranenburg profile image
Ferry Kranenburg

If anyone is running npm in command prompt, change script in package.json to this:

"scripts": {
    "predev": "echo dev > public/hot",
    "dev": "vite",
    "preprod": "echo prod > public/hot",
    "prod": "vite build"
Enter fullscreen mode Exit fullscreen mode

Because 'echo' adds a newline at the end of the file you also need to change vite.php this line:

$devServerIsRunning = str_contains(file_get_contents(public_path('hot')), 'dev');

bertugkorucu profile image
Bertug Korucu

Yeah, that was the reason I used printf instead of echo