likecoin / liker-land

Decentralize publishing. Own your content.
https://liker.land
GNU General Public License v3.0
7 stars 13 forks source link

Split and lazy load i18n locale json #325

Open williamchong opened 4 years ago

williamchong commented 4 years ago

Currently webpack packs all locale json into a same js file with other modules. Since it is a common module, every entry point will load this js. Having all locales in there bloats up this js file, thus increasing every page's js parsing time.

We should consider splitting up the locale json via webpack lazy import and lazyload it into the i18n module.

williamchong commented 4 years ago

Ref: we could write something similar to https://github.com/likecoin/like-co/blob/b1bde01cb9d4e91bc9d04ccdff202981d098dff2/plugins/vue-i18n.js#L50 but the i18n store here might be different thus need to confirm the flow is correct