Use single webpack build + embed only used locales in the HTML file #2369
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
bundle.js
size - resolves speed up multi-language build #2342locales
inhelpers/translation.js
which clears upbundle.js
of all the locales data (reducing back its size) but doesn't provide the locales info in the JSserver.js
andgenerate-index.js
embed max 2 locales in the rendered HTML files (the current locale + english as a fallback), slightly increasing their size (still keeping them < 100kB)Tested
./mobileapp/generate-index.js
and verified that the HTMLs get generateddocker-compose build && docker-compose up
works also with changing the languagesdocker-compose run ... web npm run watch && yarn start
works also with changing the languagesChecklist
Ideas for the Future
locale
as a variable in the Redux state instead of the Express server