Why is my new Laravel project over 4GB in size?

0
1
Asked By CuriousCoder89 On

I just created a new project using the Laravel Livewire starter kit, and surprisingly, it's already over 4GB in size without me adding anything to it. Is this normal for a new project? If not, how can I reduce the project size?

4 Answers

Answered By NodeNerd101 On

Chances are, that huge size is coming from the 'node_modules' folder that gets included with the Livewire kit. Those frontend tools (like Vite and Tailwind) can really add up. The actual Laravel code is probably just around 50MB. You can run `du -sh *` in your project directory to see what’s using the space. When deploying, you’ll want to leave out 'node_modules' and run `npm install` on your server instead.

Answered By CriticalChecker On

Even with 'node_modules' and the 'vendor' directory, a new starter project shouldn’t really hit 4GB. It might be worth checking your composer and package.json files. If you're unsure what's needed, get some help from an AI tool that can guide you on what might be bloating your project.

Answered By OptimizationGuru On

Most likely, it's the 'vendor' directory that's causing the bulk of the size. When installing your packages with Composer, use the `--no-dev` flag. It’s also a good idea to add `--optimize-autoloader` for production. But honestly, if it's just for development, 4GB isn’t the end of the world.

Answered By SpaceSaver42 On

It sounds a bit unusual for a new Laravel project to be that big, unless you're storing files directly in the 'storage' folder. You could use a tool like Treesize to check your project folder and see what's taking up all the space.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.