{"id":15679296,"url":"https://github.com/ph1p/i18next-scanner-webpack","last_synced_at":"2025-06-25T01:33:29.590Z","repository":{"id":26922439,"uuid":"111929308","full_name":"ph1p/i18next-scanner-webpack","owner":"ph1p","description":"Simple i18n-scanner webpack plugin","archived":false,"fork":false,"pushed_at":"2023-03-14T23:59:30.000Z","size":2098,"stargazers_count":12,"open_issues_count":3,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-14T20:18:30.294Z","etag":null,"topics":["i18n","i18next","i18next-scanner","webpack"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ph1p.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-24T14:53:33.000Z","updated_at":"2022-02-19T21:36:48.000Z","dependencies_parsed_at":"2024-06-19T00:13:32.288Z","dependency_job_id":null,"html_url":"https://github.com/ph1p/i18next-scanner-webpack","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ph1p%2Fi18next-scanner-webpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ph1p%2Fi18next-scanner-webpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ph1p%2Fi18next-scanner-webpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ph1p%2Fi18next-scanner-webpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ph1p","download_url":"https://codeload.github.com/ph1p/i18next-scanner-webpack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252850593,"owners_count":21813988,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["i18n","i18next","i18next-scanner","webpack"],"created_at":"2024-10-03T16:28:26.207Z","updated_at":"2025-05-07T09:29:05.912Z","avatar_url":"https://github.com/ph1p.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## i18next-scanner-webpack\n\n[![npm](https://img.shields.io/npm/v/i18next-scanner-webpack.svg)](https://www.npmjs.com/package/i18next-scanner-webpack) [![Build Status](https://github.com/ph1p/i18next-scanner-webpack/workflows/Test%20and%20publish%20to%20npm/badge.svg)]()\n\nThis is a simple i18n-scanner webpack-plugin.\nBased on this package: [i18next-parser](https://github.com/i18next/i18next-parser).\n\n**Example webpack.config.js**\n\n```javascript\nconst path = require('path');\nconst i18nextWebpackPlugin = require('i18next-scanner-webpack');\n\nmodule.exports = {\n  mode: 'development',\n  entry: path.resolve(__dirname, './src/index.js'),\n  output: {\n    path: path.resolve(__dirname, 'dist'),\n    filename: '[name].js'\n  },\n  plugins: [\n    new i18nextWebpackPlugin({\n      // src defaults to ./src\n      // dest defaults to ./ (project root folder)\n      // default ['.js', '.jsx', '.vue']\n      extensions: ['.js', '.jsx']\n      // See options at https://github.com/i18next/i18next-parser#options\n      options: {\n        lexers: {\n          js: [{\n            lexer: 'JavascriptLexer',\n            // default ['t']\n            functions: ['t', '$t', 'i18next.t', 'i18n.t'],\n          }]\n        },\n        locales: ['en', 'de'],\n        // defaults to locales/$LOCALE/$NAMESPACE.json\n        output: '$LOCALE/$NAMESPACE.json'\n      }\n    })\n  ]\n};\n```\n\n**Minimal setup:**\n\n```javascript\nconst path = require('path');\nconst i18nextWebpackPlugin = require('i18next-scanner-webpack');\n\nmodule.exports = {\n  mode: 'development',\n  entry: path.resolve(__dirname, './src/index.js'),\n  output: {\n    path: path.resolve(__dirname, 'dist'),\n    filename: '[name].js'\n  },\n  plugins: [\n    new i18nextWebpackPlugin({\n      options: {\n        locales: ['en', 'de']\n      }\n    })\n  ]\n};\n```\n\n**Faster dev loops:**\n\nIf `async` option is `true`, the plugin will not wait for `i18next-scanner` to finish before reporting back to webpack. Useful in large projects or when using an expensive `transform`.\n\n```javascript\nconst path = require('path');\nconst i18nextWebpackPlugin = require('i18next-scanner-webpack');\n\nmodule.exports = {\n  mode: 'development',\n  entry: path.resolve(__dirname, './src/index.js'),\n  output: {\n    path: path.resolve(__dirname, 'dist'),\n    filename: '[name].js'\n  },\n  plugins: [\n    new i18nextWebpackPlugin({\n      options: {\n        locales: ['en', 'de']\n      },\n      async: true\n    })\n  ]\n};\n```\n\n| Name      | Description                                    | default   | Optional |\n| --------- | ---------------------------------------------- | --------- | -------- |\n| src       | source path of files with i18next translations | ./src     | yes      |\n| dest      | destination of translation files               | ./locales | yes      |\n| options   | all options                                    |           | yes      |\n| async     | If true, immediately report back to webpack    | false     | yes      |\n\nAvailable options: [here](https://github.com/i18next/i18next-parser#options)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fph1p%2Fi18next-scanner-webpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fph1p%2Fi18next-scanner-webpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fph1p%2Fi18next-scanner-webpack/lists"}