{"id":18800528,"url":"https://github.com/lingui/swc-plugin","last_synced_at":"2025-05-16T13:04:37.532Z","repository":{"id":64998832,"uuid":"578659275","full_name":"lingui/swc-plugin","owner":"lingui","description":"A SWC Plugin For LinguiJS","archived":false,"fork":false,"pushed_at":"2025-04-14T08:29:56.000Z","size":547,"stargazers_count":66,"open_issues_count":4,"forks_count":20,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-12T21:17:41.529Z","etag":null,"topics":["hacktoberfest","i18n","icu","internationalization","lingui","messageformat","swc","swc-plugin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@lingui/swc-plugin","language":"Rust","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/lingui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2022-12-15T15:20:37.000Z","updated_at":"2025-04-14T08:29:30.000Z","dependencies_parsed_at":"2024-01-23T21:23:03.892Z","dependency_job_id":"0afc898e-d952-4093-8555-18658cd70575","html_url":"https://github.com/lingui/swc-plugin","commit_stats":{"total_commits":124,"total_committers":9,"mean_commits":"13.777777777777779","dds":"0.33870967741935487","last_synced_commit":"625b4f29dd5cfb9a476f959b2886d35ba31e7537"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lingui%2Fswc-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lingui%2Fswc-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lingui%2Fswc-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lingui%2Fswc-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lingui","download_url":"https://codeload.github.com/lingui/swc-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254535826,"owners_count":22087398,"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":["hacktoberfest","i18n","icu","internationalization","lingui","messageformat","swc","swc-plugin"],"created_at":"2024-11-07T22:18:56.482Z","updated_at":"2025-05-16T13:04:37.525Z","avatar_url":"https://github.com/lingui.png","language":"Rust","readme":"# \u003cdiv align=\"center\"\u003eA SWC Plugin For LinguiJS\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\nA Rust versions of [LinguiJS Macro](https://lingui.dev/ref/macro) [\u003cimg src=\"https://img.shields.io/badge/beta-yellow\"/\u003e](https://github.com/lingui/swc-plugin)\n\n[![npm](https://img.shields.io/npm/v/@lingui/swc-plugin?logo=npm\u0026cacheSeconds=1800)](https://www.npmjs.com/package/@lingui/swc-plugin)\n[![npm](https://img.shields.io/npm/dt/@lingui/swc-plugin?cacheSeconds=500)](https://www.npmjs.com/package/@lingui/swc-plugin)\n[![CI](https://github.com/lingui/swc-plugin/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/lingui/swc-plugin/actions/workflows/ci.yml)\n[![GitHub contributors](https://img.shields.io/github/contributors/lingui/swc-plugin?cacheSeconds=1000)](https://github.com/lingui/swc-plugin/graphs/contributors)\n[![GitHub](https://img.shields.io/github/license/lingui/swc-plugin)](https://github.com/lingui/swc-plugin/blob/main/LICENSE)\n\n\u003c/div\u003e\n\n## Installation\n\nInstall plugin:\n```bash\nnpm install --save-dev @lingui/swc-plugin\n# or\nyarn add -D @lingui/swc-plugin\n```\n\nYou still need to install `@lingui/macro` for typings support:\n```bash\nnpm install @lingui/macro\n# or\nyarn add @lingui/macro\n```\n\n## Usage\n\n`.swcrc`\nhttps://swc.rs/docs/configuration/swcrc\n\n```json5\n{\n  \"$schema\": \"https://json.schemastore.org/swcrc\",\n  \"jsc\": {\n    \"experimental\": {\n      \"plugins\": [\n        [\n          \"@lingui/swc-plugin\",\n          {\n            // Optional\n            // Unlike the JS version this option must be passed as object only.\n            // Docs https://lingui.dev/ref/conf#runtimeconfigmodule\n            // \"runtimeModules\": {\n            //   \"i18n\": [\"@lingui/core\", \"i18n\"],\n            //   \"trans\": [\"@lingui/react\", \"Trans\"]\n            // }\n            // Lingui strips non-essential fields in production builds for performance.\n            // You can override the default behavior with:\n            // \"stripNonEssentialFields\": false/true\n          },\n        ],\n      ],\n    },\n  },\n}\n```\n\nOr Next JS Usage:\n\n`next.config.js`\n```js\n/** @type {import('next').NextConfig} */\nconst nextConfig = {\n  reactStrictMode: true,\n  experimental: {\n    swcPlugins: [\n      ['@lingui/swc-plugin', {\n       // the same options as in .swcrc\n      }],\n    ],\n  },\n};\n\nmodule.exports = nextConfig;\n```\n\n\u003e **Note**\n\u003e Consult with full working example for NextJS in the `/examples` folder in this repo.\n\n\n## Compatibility\nSWC Plugin support is still experimental. They do not guarantee a semver backwards compatibility between different `swc-core` versions.\n\nSo you need to select an appropriate version of the plugin to match compatible `swc_core` using a https://plugins.swc.rs/.\n\nBelow is a table referencing the swc_core version used during the plugin build, along with a link to the plugin's site to check compatibility with runtimes for this swc_core range.\n\n| Plugin Version                                    | used `swc_core`                                       |\n|---------------------------------------------------|-------------------------------------------------------|\n| `0.1.0`, `4.0.0-next.0`                           | `0.52.8`                                              |\n| `0.2.*`, `4.0.0-next.1` ~ `4.0.0-next.3`          | `0.56.1`                                              |\n| `4.0.0`                                           | `0.75.33`                                             |\n| `4.0.1`                                           | `0.76.0`                                              |\n| `4.0.2`                                           | `0.76.41`                                             |\n| `4.0.3`                                           | `0.78.28`                                             |\n| `4.0.4`                                           | `0.79.x`                                              |\n| `4.0.5`, `4.0.6`                                  | [`0.87.x`](https://plugins.swc.rs/versions/range/10)  |\n| `4.0.7`, `4.0.8`, `5.0.0-next.0` ~ `5.0.0-next.1` | [`0.90.35`](https://plugins.swc.rs/versions/range/12) |\n| `4.0.9`                                           | [`0.96.9`](https://plugins.swc.rs/versions/range/15)  |\n| `4.0.10`                                          | [`0.101.4`](https://plugins.swc.rs/versions/range/94) |\n| `4.1.0`, `5.0.0` ~ `5.2.0`                        | [`0.106.3`](https://plugins.swc.rs/versions/range/95) |\n| `5.3.0`                                           | [`5.0.4`](https://plugins.swc.rs/versions/range/116)  |\n| `5.4.0`                                           | [`14.1.0`](https://plugins.swc.rs/versions/range/138) |\n| `5.5.0` ~ `5.5.2`                                 | [`15.0.1`](https://plugins.swc.rs/versions/range/271) |\n\n\n\u003e **Note**\n\u003e next `v13.2.4` ~ `v13.3.1` cannot execute SWC Wasm plugins, due to a [bug of next-swc](https://github.com/vercel/next.js/issues/46989#issuecomment-1486989081).\n\u003e\n\u003e next `v13.4.3` ~ `v13.4.5-canary.7` cannot execute SWC Wasm plugins, due to [missing filesystem cache](https://github.com/vercel/next.js/pull/50651).\n\n- Version `0.1.0` ~ `0.*` compatible with `@lingui/core@3.*`\n- Version `4.*` compatible with `@lingui/core@4.*`\n- Version `5.*` compatible with `@lingui/core@5.*`\n\n## License\n\nThe project is licensed under the [MIT](https://github.com/lingui/swc-plugin/blob/main/LICENSE) license.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flingui%2Fswc-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flingui%2Fswc-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flingui%2Fswc-plugin/lists"}