On production, you probably install your packages with --no-dev flag (which is understandable) and after packages have being installed, post install scripts are executed (defined in your composer.json file). The problem might be caused because optimize command is run there by default and it doesn't know in which context it is run against. So there is a problem with no dev packages installed and autoloading tries to include files from dev packages.
You can write your own scripts that will react properly within given development environment and include them in your composer.json. Take a look here: https://getcomposer.org/doc/articles/scripts.md
Here is quick explanation about optimize command:
php artisan optimize is a wrapper aroundcomposer dump-autoload command. optimize command is not able to pass any additional flags to composer dump-autoload execution. It either updates autoload files (php artisan optimize --psr) or updates and optimizes autoload files (php artisan optimize).
Right now, there is no way to pass --no-dev flag that is supported by composer.