DEV Community

ankush-garg-maker
ankush-garg-maker

Posted on

1 1

File size is much higher

I am using react.js with laravel and I found in public/js/app.js the file size is 50 MB.
How can I reduce the size of this file?

Top comments (2)

Collapse
 
brentdalling profile image
Brent Dalling

You should look at some sort of treeshaking process and ensure that you are using a decent bundler. Also, ensure that you are using a production build of React when you run this metric. Development builds are considerably heavier than a true production build. Happy Coding!

webpack.js.org/guides/tree-shaking/
reactjs.org/docs/optimizing-perfor...

Collapse
 
ivan_jrmc profile image
Ivan Jeremic

Look at your dependencies, what dependencies are you using in your react app? Maybe you bundle more than you need.

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post