Developer654079525's avatar

Composer flags

Are --no-dev --optimize-autoloader flags required or not when using Composer to install the framework on a live server? Do you actually use those flags when deploying?

0 likes
2 replies
JussiMannisto's avatar
Level 50

--no-dev skips development packages (require-dev) when installing dependencies. You should use it in production and staging.

Laravel's composer.json has optimize-autoloader enabled by default, so the --optimize-autoloader flag is redundant and does nothing.

1 like
martinbean's avatar

@developer654079525 Yes. Why would you want to install dev dependencies in a non-dev environment such as production? Or not have the autoloader optimized in such an environment?

Please or to participate in this conversation.