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
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.
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.
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.
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
How to Build a Custom GPT Journalist That Posts Directly to WordPress
Cloudflare Origin SSL Certificate Setup Guide
How To Effectively Monetize A Site With Ads