How can I reduce my React project’s size and fix the Netlify hosting issue?

0
28
Asked By CuriousCoder42 On

I'm new to React JS and I'm working on my first project, which is an e-commerce website. The project's size has ballooned to 1.46GB mainly because all the images are stored in a local folder. I've tried compressing them, but it hasn't made a significant difference. I'm also facing challenges hosting it on Netlify; it just shows a blank white page. Any suggestions on how to reduce the size and resolve these hosting issues?

4 Answers

Answered By ImageOptimista On

Are your images really optimized for the web? It's common for newbies to upload high-res images that are too large. Make sure they're compressed properly for the web, and if you haven't tried it yet, hosting them on a service like Cloudinary could really streamline your project.

Answered By PixelPundit23 On

One good approach to reduce your project size is to host your images on a CDN instead of keeping them locally. Services like Cloudflare, AWS S3, or Azure blob storage can help free up space and improve loading times.

Answered By DevGuru99 On

You might want to clarify what you mean by project size; are you referring to repo size or bundle size? If it's the repo size, having large media files isn't ideal. Instead, consider keeping your images in the cloud. That way, your project will be lighter and should upload to Netlify without timing out.

Answered By WebWhiz34 On

It's definitely better not to commit large media files like images in a React project. Once you move them to a storage service and just reference the URLs in your code, the size issue should improve. Plus, if Netlify is showing a blank page, it could be due to the large bundle timing out during deployment. Make sure to rebuild your project after the image transfer.

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.