vite-plugin-i18next-loader weekly downloads statistics
By alienfast · npm · Vite plugins
Vite plugin loader for client embedded i18next locales composited from one to many json or yaml files.
vite-plugin-i18next-loader has 9,590 recorded weekly downloads on npm, a decrease of 52.6% over the past 30 days.
It ranks #916 of 2,251 tracked npm listings by weekly downloads.
Over 90 days, weekly downloads changed by -54.3%.
PluginStats has 542 daily observations since Apr 24, 2025; the latest is from Oct 17, 2026.
About vite-plugin-i18next-loader
vite-plugin-i18next-loader
pnpm add -D vite-plugin-i18next-loader
Vite plugin to client bundle i18next locales composited from one to many json/yaml files _from_ one to many libraries. Zero config HMR support included.
This vite-plugin i18next loader generates the resources structure necessary for i18next. The structure is made available as a virtual module to the client bundle at build time, thus avoiding loading any language resources via extra HTTP requests.
Features
• [x] Glob based file filtering • [x] One to many overrides supporting reuse cases (locales in library packages/white labeling) • [x] Yaml and Json support • [x] HMR hot module reloading • [ ] Better chunking/tree shaking may already be possible, see https://github.com/alienfast/vite-plugin-i18next-loader/issues/4 - needs more trial/discussion.
Given a locales directory, by default, the loader will find and parse any json|yaml|yml file and attribute the contents to the containing lang folder e.g. en. There is no need to add lang such as en or de inside your json or yaml files.
See the test/data directory for structure and example data.
Usage
Sample app structure
vite.config.ts
app.ts
Options
include to filtering files read
You can filter files in your file structure by specifying any glob supported by glob. By default, any json|yaml|yml in the paths directories will be loaded.
Only json
All json except one file
paths for overriding/white labeling
Applications that reuse libraries e.g. white labeling, can utilize one to many sets of locale directories that the app will override.
This configures the loader to work on a file structure like the following:
Everything from ./locales will override anything specified in one to many libraries.
namespaceResolution
Namespace resolution will impact the structure of the bundle. If you want the files' basename or relative path to be injected, look at the following options.
namespaceResolution: 'basename'
The following file structure would result in resources loaded as below:
foo.json
bar.yaml
Results in this object loaded:
namespaceResolution: 'relativePath'
The following file structure would result in resources loaded as below:
green.yaml
blue/foo.yaml
Results in this object loaded:
NOTE: If you have a file and a folder with the same name, you MIGHT overwrite one with the other. For example:
blue.yaml
blue/foo.yaml
Results in this object loaded:
But it's just overwriting based on the return value of glob-all, so you shouldn't depend on it.
Output
Note that the virtual module generated has resources that conform to the i18next resource format.
While using the output with import resources from 'virtual:i18next-loader' will not be tree-shaken, it is possible to use the named outputs with a dynamic import for tree shaking/chunking optimizations. If you take advantage of this, please see #4 and take a moment to update this doc with more information.
Additionally, the named exports of langs and namespaces are available for use in your app. This is useful for setting the supportedLngs and ns options in your i18next initialization. Importing only them will not bundle resources due to vite tree-shaking.
NOTE as shown by the test output below, due to ES syntactical rules, we cannot use hyphenated lang codes. I'm open to ideas, but in the interim, affected lang codes are exported with the hyphen converted to underscore e.g. zh-cn has a named export of zh_cn. I noted that vite allows for tree-shaking of JSON files, perhaps that is worth looking at to consider how it might help us and inform our output?
Vite typescript definitions
In order for the vite virtual module to be typechecked, you will need to a declaration. Below is an example of a common type file included in a project for vite:
Credit
This was forked from @alienfast/i18next-loader, converted to be a vite plugin and improved. Thanks to the original authors and contributors.
Description from the npm listing.
- vite-plugin
- loader
- i18next
- locales
- yaml
- json
Where vite-plugin-i18next-loader sits in the listing
Each band is one page of 20. Weekly downloads on a log scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Recent observations
Full history (542)Similar npm Vite plugins plugins
Data source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/vite-plugin-i18next-loader. First seen Oct 16, 2026; last successful collection Oct 18, 2026. See the methodology.