hslayers / hslayers-ng

User interface and map building extensions for OpenLayers
https://ng.hslayers.org/
MIT License
36 stars 20 forks source link

Don't include all locales in bundle by default #2224

Closed raitisbe closed 2 years ago

raitisbe commented 2 years ago

Bug

Describe the bug We need a way how to specify which translations (/locales/*.json) to include in bundle. Not always all of them are necessary and each of them adds 26KB to the resulting bundle - now 119KB total.

Furthermore when sourcemaps are analyzed with source-map-explorer , the locales end up counted towards random module sizes i.e. compositions.module for example which gets reported being 119KB large. In reality its just ~1KB in size.

Expected behavior Locales should be treated as other assets and not included in the bundle. Its up to the developer of container application to load and enable the locales.

They could be included in hslayers-app, but not completely (just English) and the rest of languages should be loaded with HttpClient.

raitisbe commented 2 years ago

Mystery content with most of hslayers modules not included: image