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" }
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');
Yeah, that was the reason I used printf instead of echo
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
If anyone is running npm in command prompt, change script in package.json to this:
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');
Yeah, that was the reason I used printf instead of echo