webpack-extract-translation-keys-plugin weekly downloads statistics
By grassator · npm · Webpack plugins
Webpack plugin to extract list of used translation keys from included modules.
webpack-extract-translation-keys-plugin has 201 recorded weekly downloads on npm, a decrease of 39.6% over the past 30 days, ranking #1595 of 2,256 tracked listings.
About webpack-extract-translation-keys-plugin
Webpack Extract Translation Keys Plugin
Webpack provides an official plugin for managing translation using i18n-webpack-plugin, but in only allows for build-time translations by replacing strings in the source code.
This plugin serves a similar purposes, but instead of replacing translation keys with actual string values it just collects translation keys allowing you to know exactly which translations are necessary for your client side.
Approach like this also allows to provide dynamically generated translation bundles to the client allowing you to get real-time updates to translation without regenerating whole client side bundle.
This plugin also compatible with Webpack 5.
Usage
Configuration
First you need to install plugin:
And then include it in your configuration:
Now inside your module you can write something like this:
If you run webpack now, you should get dist/translation-keys.json file with following content:
It may seems like a waste to output a map with the keys and values being the same thing, the purpose is to keep the output format consistent with the times when the mangle option is enabled.
Output
if output string contains [name], one output file will be created per entry key at corresponding output
Key Mangling
In some applications translation keys are quite long, so for the situtations where you want to save some additional bytes in your application, you can enable mangling during the plugin initialization:
This setting changes the behavior of the plugin to replace the key name with a minimal ascii-readable string.
In order to be able to map back to the original translation key, the plugin outputs mapping object with keys being original keys and the values being the mangled ones:
It's recommended to only enable mangling for production builds, as it makes the debugging harder and also may break hot reloading, depending on your setup.
Runtime
Since this plugin doesn't replace function with something else it's up to you to provide function that will actually handle translation in the runtime. It can be a globally defined function or you can use webpack.ProvidePlugin inside your configuration:
Default options
• functionName : __ • done : function (result) {} • output : false • mangle : false
Error handling
Plugin throw an error if you try to call the translation function without any arguments or with a non-string argument (e.g. a variable).
Release Notes
6.2.0
Support concatenated strings as keys: __("a" + "b" + "c").
6.1.0
Fix a deprecation warning.
6.0.0
Support for Webpack 5, if you are using Webpack 4, please install 5.x.x version of this plugin. This can be done by running:
5.0.0
Support for multiple output for multiple entries with [name] inside the output string. If [name] is not present, only one output file will be created for all entries
4.0.0
Support for Webpack 4, if you are using Webpack 3, please install 3.x.x version of this plugin. This can be done by running:
3.0.0
Support for Webpack 2, if you are using Webpack 1, please install 2.x.x version of this plugin. This can be done by running:
2.0.0
Support for key mangling. The format of the output without mangling has changed from array to a map. If you want to have old behavior, you can implement it using done callback option.
License
Copyright 2015 Dmitriy Kubyshkin
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Description from the npm listing.
- webpack
- webpack-plugin
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
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.
Each band is one page of 20. Weekly downloads on a linear 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.
Recent observations
Full history (121)Similar npm Webpack plugins plugins
All 20 webpack-extract-translation-keys-plugin alternativesData 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/webpack-extract-translation-keys-plugin. First seen Oct 16, 2026; last successful collection Oct 19, 2026. See the methodology.