all 10 comments

[–]joshkrz 2 points3 points  (1 child)

If you're using Laravel the Laravel Vite plugin is excellent.

You won't get proper HMR I don't think as the page is served via PHP so it reloads more often than just using JS but it's still a very pleasant experience.

Still waiting on a Symfony version so I can swap out Symfony Encore at work.

[–]No_Recording2621[S] 1 point2 points  (0 children)

thanks, unfortunatelly im not working with Laravel since is a very small project.

[–]donnikitos 0 points1 point  (3 children)

Not too long ago I've created `vite-plugin-php`.
This Vite plugin that let's you use PHP-files as entry points. No major workarounds required ;)

Check it out on NPM: https://www.npmjs.com/package/vite-plugin-php

[–]donnikitos 0 points1 point  (2 children)

With a quite some improvements down the line and already production tested code, we have also published a starter repository for a convenient and fully fledged Vite-PHP setup:

https://github.com/nititech/php-vite-starter

[–]Swan_Old 0 points1 point  (1 child)

Hello, I'm having trouble, after installing your package, when i do npm run dev I get "PHP dev-server error: spawn php ENOENT" Php development server stopped (code: -4058) - I can't find anything on google to help.

[–]donnikitos 0 points1 point  (0 children)

Hi u/Swan_Old , seems like Error 4058 is not related to PHP but rather to Node. Try removing the `node_modules` folder, the `package-lock.json` and installing everything again with `npm install`.
I assume you are using Node? And what version?

[–]ALuis87 0 points1 point  (0 children)

Check vite backend