I wrote a REST-API application using PHP Slim4 framework. However, now that I want to deploy the application. I cannot seem to find an intuitive tool like webpack to bundle my app into a few files and do the tree shaking for any unused code.
Are there any tools that people use with PHP for deployment? I'm not used to deploying PHP apps so I'm not sure what are the best practices for deploying PHP applications into the wild?
You don't need tree shaking in PHP, you can load needed classes using lazy loading. For that you need autoloading which can load the class file when the class is needed.
If you really want to have everything in one file you can use the phar "archive", you can do it manually or with tools like box but you don't need it to deploy code in production, it's usually not needed.