`composer dump-autoload`
This will dump the autoloader and rebuild it. This is much much faster than an entire `composer install` run. For additional usage options try:
`composer help dump-autoload`
* Unrelated: HN can we please get better markdown?
Yours is not really a critique of composer, since it's not a daemon or a continuously run script. You run it once and done.
watch -n 10 composer dumpautoloaf --no-scripts &
Full disclosure: I did not verify this command would work wellNPM? Wake up on a saturday morning and hot reload + react tools no longer works? F me.
On the bright side I almost finished the front end, so I can casually mess around with the solution every few days as I do my daily work in laravel.
Also, package.json is arguably a pretty gnarly way to organize... Well, everything? It's the kitchen sink of configuration, but it's supposed to be for managing packages. But no, you can also configure your packages in there, configure scripts for your application, etc. It's nuts.
Even so, both of them are miles ahead of what we had 10 years ago!
Recent example: Re-organizing namespaces and classes in an internal library. Losing my mind (doing everything right) until finally realizing Composer wasn't updating the autoloader to reflect changes to the lib's composer.json.
For something that works really well when itβs working, I have blown a lot of hours fighting with this stuff.