Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ export default function initExtractionCompiler(pluginConfig: PluginConfig) {
// - lint
//
// What remains are:
// - dev (NODE_ENV=development)
// - dev (NODE_ENV=development), skipped when devExtraction is false
// - build (NODE_ENV=production)
const shouldRun = isDevelopment || isNextBuild;
const devExtraction = experimental.extract?.devExtraction !== false;
const shouldRun = (isDevelopment && devExtraction) || isNextBuild;
if (!shouldRun) return;

runOnce(() => {
Expand Down
6 changes: 6 additions & 0 deletions packages/next-intl/src/plugin/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ export type PluginConfig = {
/** Enables the usage of `useExtracted`, to be used in combination with `srcPath` and `messages`. */
extract?: {
sourceLocale: string;
/**
* Whether to automatically extract messages during `next dev`.
* The SWC transform for `useExtracted` runs regardless.
* @default true
*/
devExtraction?: boolean;
};
};
};
Expand Down
Loading