alienfast/i18next-loader

Chunked locales via webpack `import`

rosskevin opened this issue · 4 comments

Currently we will bundle all locales. While this is good for a small number of locales, a serious application with 10 languages may experience increased bundle size that is unacceptable.

I think this implementation is a good basis and we shouldn't be far away from being able to chunk a specific locale. It would require a bit of research into the webpack api and perhaps a breaking change.

At this point I have no need for it, so please don't ask when it will be done. If I need it, I'll assign it to myself and do it. BUT, if you are interested in doing it, I'm open to breaking changes and ready and willing to discuss/consult.

eseQ commented

Hi, will be nice. And one more feature - locales for modules.
For example: I have some modules-custom packages, I using it theirs in my project like chunks. I want save package locales inside package without import to main app.

@rosskevin have you thought much about how you would do it? It's something my company is very interested in. We support 40+ languages and might have resources to implement it.

@tylergraf I haven't thought much about it but welcome the PR. I've been meaning to switch this over to typescript as well (all of our other code is).

Any and all help is welcome.

We have switched our toolchain to use vite instead of webpack. While this plugin will still work, I'm not likely to be putting effort into maintaining this project, but will certainly accept and merge pull requests.

If you haven't used vite yet, I encourage you to try it! AND...I have migrated this plugin to work with vite so you can keep doing the same thing with your locale files! 1.0.0 just released and hmr is in the works https://github.com/alienfast/vite-plugin-i18next-loader.