A webpack plugin that automatically extracts i18n translation keys from your source code using i18next-parser. Integrates with webpack 5.x and requires Node.js >= 14.16.0. Version 1.0.0 includes breaking changes from v0.9.0: replaced the underlying scanner with i18next-parser. The plugin scans specified file extensions for translation function calls like t() and generates locale JSON files. Supports both ESM and CommonJS configs, async mode for faster dev builds, and customizable lexers for different file types. Differentiators: simple setup, tight webpack integration, and active maintenance.
npm install i18next-scanner-webpackVerified import paths — ran on the pinned version, not inferred.
Sets up i18next-scanner-webpack in webpack 5 with ESM config, scanning .js and .jsx files for translation keys, outputting English and German locale files.
Migrate config to use i18next-parser options (see v0.9.0 changelog). Example: replace `func` with `lexers`, `lngs` with `locales`, etc.
Upgrade to Webpack 5 if using v1.0.0+. For Webpack 4, use v0.8.3 or earlier.
Only use `async: true` in development mode. For production, set `async: false` (default).
Remove `.default` when requiring via CommonJS.
Update to v0.9.0+ and migrate config to i18next-parser format.
Run `npm install i18next-parser --save-dev` or check that it is in your dependencies.
Use `const I18nextWebpackPlugin = require('i18next-scanner-webpack');` without `.default`.Wrap i18next-parser options in an `options` property: `new I18nextWebpackPlugin({ options: { locales: ['en'] } })`.Add lexers for TypeScript: `options.lexers.ts: [{ lexer: 'JavascriptLexer', functions: ['t'] }]`.