feat: add devExtraction option to skip catalog writes during dev#2292
Open
sezze wants to merge 1 commit intoamannn:mainfrom
Open
feat: add devExtraction option to skip catalog writes during dev#2292sezze wants to merge 1 commit intoamannn:mainfrom
devExtraction option to skip catalog writes during dev#2292sezze wants to merge 1 commit intoamannn:mainfrom
Conversation
Add `devExtraction` option to the `extract` config. When set to `false`,
the `ExtractionCompiler` (which scans source files and writes message
catalogs) is skipped during `next dev`, while the SWC extraction loader
(which compiles `useExtracted` into `useTranslations`) continues to run.
This enables a workflow where:
1. Developers use `useExtracted` in code as normal
2. `next dev` does not write PO/JSON files, keeping the working tree clean
3. Message extraction runs via `unstable_extractMessages` in CI or a
separate script (e.g. a GitHub Action)
4. `next build` still runs extraction as before
Usage:
```ts
createNextIntlPlugin({
experimental: {
srcPath: './src',
extract: {
sourceLocale: 'en',
devExtraction: false
},
messages: { path: './messages', format: 'po', locales: 'infer' }
}
});
```
Defaults to `true` for full backwards compatibility.
|
@sezze is attempting to deploy a commit to the next-intl Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
devExtractionoption to theextractconfig. When set tofalse, theExtractionCompiler(which scans source files and writes message catalogs) is skipped duringnext dev, while the SWC extraction loader (which compilesuseExtractedintouseTranslations) continues to run.This enables a workflow where:
useExtractedin code as normalnext devdoes not write PO/JSON files, keeping the working tree cleanunstable_extractMessagesin CI or a separate script (e.g. a GitHub Action)next buildstill runs extraction as beforeUsage:
Defaults to
truefor full backwards compatibility.