Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate if and how to implement code splitting for the React App #205

Closed
matiasbenedetto opened this issue Feb 2, 2023 · 2 comments · Fixed by #209
Closed

Evaluate if and how to implement code splitting for the React App #205

matiasbenedetto opened this issue Feb 2, 2023 · 2 comments · Fixed by #209
Labels
enhancement New feature or request question Further information is requested

Comments

@matiasbenedetto
Copy link
Contributor

More context on: #194 (review)

@t-hamano
Copy link
Contributor

t-hamano commented Feb 3, 2023

I used the following command to find out which modules were affected:

npm run build -- --webpack-bundle-analyzer

analyzer

We can see that the fallback-fonts-list.json file is the primary cause of the large build size. Therefore, I think splitting the React component would not be effective.

This file has a file size of 1.10 MB even before build. And this file is imported here:

import googleFontsData from "../../assets/google-fonts/fallback-fonts-list.json";

This file is generated from data obtained from the Google Web Font API. However, only some properties of this file are used in the React app.

By narrowing down to the necessary data, it may be possible to reduce the bundle size.

@t-hamano
Copy link
Contributor

t-hamano commented Feb 3, 2023

Still testing, but #209 confirms that the build folder size can be reduced from about 110KB to 120KB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants