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

Reduce build size #951

Merged
merged 6 commits into from
Oct 9, 2024
Merged

Reduce build size #951

merged 6 commits into from
Oct 9, 2024

Conversation

Falinor
Copy link
Collaborator

@Falinor Falinor commented Oct 9, 2024

@faker-js/faker was included with all of its locales in the front production build, which made it 11 MB ungzipped and 7.69 MB gzipped, taking up to 5.13 MB (66.7 % of the whole bundle size).

Screenshot 2024-10-09 at 09 47 15

react-scripts was compiling using tsconfig.json, which included test files, the mock API for frontend tests, etc. Typescript compilation was removed and replaced by a manual step before react-scripts build, using tsconfig.build.json.

Also, @zerologementvacant/models was split between @zerologementvacant/models (shared types) and @zerologementvacant/models/fixtures (shared factories for DTO types, for test purposes).

The resulting production bundle does not include @faker-js/faker from the build, as intended, which reduces its size down to 2.55 MB ungzipped, 530 KB gzipped.

Screenshot 2024-10-09 at 09 47 28

Copy link
Collaborator

@loicguillois loicguillois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

top 🔥

@Falinor Falinor merged commit 911c5e9 into main Oct 9, 2024
13 checks passed
@Falinor Falinor deleted the chore-reduce-build-size branch October 9, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants