Skip to content

feat: add devExtraction option to skip catalog writes during dev#2292

Open
sezze wants to merge 1 commit intoamannn:mainfrom
sezze:feat/extract-dev-option
Open

feat: add devExtraction option to skip catalog writes during dev#2292
sezze wants to merge 1 commit intoamannn:mainfrom
sezze:feat/extract-dev-option

Conversation

@sezze
Copy link
Copy Markdown

@sezze sezze commented Mar 24, 2026

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:

createNextIntlPlugin({
  experimental: {
    srcPath: './src',
    extract: {
      sourceLocale: 'en',
      devExtraction: false
    },
    messages: { path: './messages', format: 'po', locales: 'infer' }
  }
});

Defaults to true for full backwards compatibility.

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.
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 24, 2026

@sezze is attempting to deploy a commit to the next-intl Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant