ddev-viteserve
ddev-viteserve copied to clipboard
Possible to get logs / output?
ddev logs -f doesn't output any of the vite output. But I wonder if this is possible?
I'm not too surprised, since IIRC vite is running in a separate process, using a program call tmux. To see any output created by the vite process, we could do something like this:
- Use tmux to bring forward the vite process. I haven't tried this (or at least, haven't tried it in quite a while), but I believe you can do something like this:
tmux attach-session -t vite-sess
- If there was a large need for this, I could make it possible to expose stderr and stdout when I bring up the tmux session that runs vite. This would be a bit nasty, and if you can make due with (1), much better.
I have made do with 1 but maybe there could be an additional option like ddev vite-serve listen.
The listen (or another name) argument would be the same as running npm run vite in that errors would come to stdout, I would prefer to have an open vite process rather than one running in a tmux session that I don't have output for without running 1.
To add to this, where for some reason Vite restarts and has a error where it starts on the port +1, I have no idea on this until I use the above to realise why.
Perhaps option 2 should be looked at and at the very least the text about port being taken should be parsed and output as an error to flag?