Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ryanmortier's avatar

Why are Laravel's package.json dependancies using dev?

This file: https://github.com/laravel/laravel/blob/master/package.json

Why are all the dependancies in devDependencies rather than dependencies?

Are they assuming that you're commiting your compiled assets? Otherwise, when you deploy to production, you still are going to be doing npm install, right?

Should we be commiting compiled assets or no?

0 likes
2 replies
ryanmortier's avatar

Hmm, that didn't really clear it up?

If you aren't publishing to npm, it technically doesn't matter which flag you use. However, I find it a good practice to use the "--save" flag for modules that affect the source code that you write. Then use the "--save-dev" flag for modules that are required for your compiler to function.

So, looking at Laravel's devDependencies, we see several of them affect the source code we write, for example: Lodash.

Please or to participate in this conversation.