React project size

JohnH

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
1,680
Location
Norway
Programming Experience
10+
I tested this and is curious about the size on disk: Use the React project template with ASP.NET Core
After creating the project from template the size is 772KB.
After building (or 'npm install') that downloads npm dependencies the size is formidable, 238MB, most of it in ClientApp/node_modules 236MB and the largest here is Typescript 49MB. Clientapp now contains close to 35000 files in 5000 folders!

Then I tried this out: Analyzing the Bundle Size | Create React App and get:

1608684757790.png


If I understand this correctly the ClientApp is bundled to only 194KB scripts? That is the combined size of three .js files in build/static folder. The build folder is actually (only) 1.4MB in total.

Anyone knows what's with the file sizes here? Is a complete library of base modules added to project, and only used parts included minified in build?

ClientApp "is a standard CRA React app", so I also tested Getting Started | Create React App and get similar sizes for that, both for source and build.
 
Back
Top Bottom