next-intl 4.8.0 → 4.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var plugin = require('./plugin-CCD2rOD7.cjs');
3
+ var plugin = require('./plugin-YzBhQjAo.cjs');
4
4
  var ExtractorCodec = require('./ExtractorCodec-D9Tw618d.cjs');
5
5
  require('fs/promises');
6
6
  require('path');
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var POParser = require('po-parser');
4
- var plugin = require('./plugin-CCD2rOD7.cjs');
4
+ var plugin = require('./plugin-YzBhQjAo.cjs');
5
5
  var ExtractorCodec = require('./ExtractorCodec-D9Tw618d.cjs');
6
6
  require('fs/promises');
7
7
  require('path');
@@ -122,11 +122,11 @@ export default messages;`;
122
122
 
123
123
  const formats = {
124
124
  json: {
125
- codec: () => Promise.resolve().then(function () { return require('./JSONCodec-NF5qwUOq.cjs'); }),
125
+ codec: () => Promise.resolve().then(function () { return require('./JSONCodec-rhejs716.cjs'); }),
126
126
  extension: '.json'
127
127
  },
128
128
  po: {
129
- codec: () => Promise.resolve().then(function () { return require('./POCodec-CJZiOW7K.cjs'); }),
129
+ codec: () => Promise.resolve().then(function () { return require('./POCodec-Cv3VdXQG.cjs'); }),
130
130
  extension: '.po'
131
131
  }
132
132
  };
@@ -990,7 +990,7 @@ class LRUCache {
990
990
  }
991
991
  }
992
992
 
993
- const require$2 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('plugin-CCD2rOD7.cjs', document.baseURI).href)));
993
+ const require$2 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('plugin-YzBhQjAo.cjs', document.baseURI).href)));
994
994
  class MessageExtractor {
995
995
  compileCache = new LRUCache(750);
996
996
  constructor(opts) {
@@ -1083,6 +1083,15 @@ class ExtractionCompiler {
1083
1083
  }
1084
1084
  }
1085
1085
 
1086
+ // Avoid rollup's `replace` plugin to compile this away
1087
+ const nodeEnvKey = 'NODE_ENV'.trim();
1088
+
1089
+ // We avoid reading `argv.includes('dev')` related to
1090
+ // https://github.com/amannn/next-intl/issues/2006
1091
+ const isDevelopment = process.env[nodeEnvKey] === 'development';
1092
+ const isNextBuild = process.argv.includes('build');
1093
+ const isDevelopmentOrNextBuild = isDevelopment || isNextBuild;
1094
+
1086
1095
  // Single compiler instance, initialized once per process
1087
1096
  let compiler;
1088
1097
  const runOnce = once('_NEXT_INTL_EXTRACT');
@@ -1092,9 +1101,6 @@ function initExtractionCompiler(pluginConfig) {
1092
1101
  return;
1093
1102
  }
1094
1103
 
1095
- // Avoid rollup's `replace` plugin to compile this away
1096
- const isDevelopment = process.env['NODE_ENV'.trim()] === 'development';
1097
-
1098
1104
  // Avoid running for:
1099
1105
  // - info
1100
1106
  // - start
@@ -1107,7 +1113,7 @@ function initExtractionCompiler(pluginConfig) {
1107
1113
  // What remains are:
1108
1114
  // - dev (NODE_ENV=development)
1109
1115
  // - build (NODE_ENV=production)
1110
- const shouldRun = isDevelopment || process.argv.includes('build');
1116
+ const shouldRun = isDevelopment || isNextBuild;
1111
1117
  if (!shouldRun) return;
1112
1118
  runOnce(() => {
1113
1119
  const extractorConfig = {
@@ -1142,7 +1148,7 @@ function initExtractionCompiler(pluginConfig) {
1142
1148
 
1143
1149
  function getCurrentVersion() {
1144
1150
  try {
1145
- const require$1 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('plugin-CCD2rOD7.cjs', document.baseURI).href)));
1151
+ const require$1 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('plugin-YzBhQjAo.cjs', document.baseURI).href)));
1146
1152
  const pkg = require$1('next/package.json');
1147
1153
  return pkg.version;
1148
1154
  } catch (error) {
@@ -1169,10 +1175,15 @@ function isNextJs16OrHigher() {
1169
1175
  return compareVersions(getCurrentVersion(), '16.0.0') >= 0;
1170
1176
  }
1171
1177
 
1172
- const require$1 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('plugin-CCD2rOD7.cjs', document.baseURI).href)));
1178
+ const require$1 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('plugin-YzBhQjAo.cjs', document.baseURI).href)));
1173
1179
  function withExtensions(localPath) {
1174
1180
  return [`${localPath}.ts`, `${localPath}.tsx`, `${localPath}.js`, `${localPath}.jsx`];
1175
1181
  }
1182
+ function normalizeTurbopackAliasPath(pathname) {
1183
+ // Turbopack alias targets should use forward slashes; Windows backslashes can
1184
+ // break resolution in dev (see `next-intl/config` alias path style).
1185
+ return pathname.replace(/\\/g, '/');
1186
+ }
1176
1187
  function resolveI18nPath(providedPath, cwd) {
1177
1188
  function resolvePath(pathname) {
1178
1189
  const parts = [];
@@ -1184,7 +1195,10 @@ function resolveI18nPath(providedPath, cwd) {
1184
1195
  return fs__default.default.existsSync(resolvePath(pathname));
1185
1196
  }
1186
1197
  if (providedPath) {
1187
- if (!pathExists(providedPath)) {
1198
+ // We use the `isNextDevOrBuild` condition to avoid throwing errors
1199
+ // if `next.config.ts` is read by a non-Next.js process.
1200
+ // https://github.com/amannn/next-intl/discussions/2209#discussioncomment-15650927
1201
+ if (isDevelopmentOrNextBuild && !pathExists(providedPath)) {
1188
1202
  throwError(`Could not find i18n config at ${providedPath}, please provide a valid path.`);
1189
1203
  }
1190
1204
  return providedPath;
@@ -1194,13 +1208,16 @@ function resolveI18nPath(providedPath, cwd) {
1194
1208
  return candidate;
1195
1209
  }
1196
1210
  }
1197
- throwError(`Could not locate request configuration module.\n\nThis path is supported by default: ./(src/)i18n/request.{js,jsx,ts,tsx}\n\nAlternatively, you can specify a custom location in your Next.js config:\n\nconst withNextIntl = createNextIntlPlugin(
1198
-
1199
- Alternatively, you can specify a custom location in your Next.js config:
1211
+ if (isDevelopmentOrNextBuild) {
1212
+ throwError(`Could not locate request configuration module.\n\nThis path is supported by default: ./(src/)i18n/request.{js,jsx,ts,tsx}\n\nAlternatively, you can specify a custom location in your Next.js config:\n\nconst withNextIntl = createNextIntlPlugin(\n './path/to/i18n/request.tsx'\n);`);
1213
+ }
1200
1214
 
1201
- const withNextIntl = createNextIntlPlugin(
1202
- './path/to/i18n/request.tsx'
1203
- );`);
1215
+ // Default as fallback
1216
+ if (pathExists('./src')) {
1217
+ return './src/i18n/request.ts';
1218
+ } else {
1219
+ return './i18n/request.ts';
1220
+ }
1204
1221
  }
1205
1222
  }
1206
1223
  function getNextConfig(pluginConfig, nextConfig) {
@@ -1286,7 +1303,7 @@ function getNextConfig(pluginConfig, nextConfig) {
1286
1303
  if (!formatOnlyPath.startsWith('.')) {
1287
1304
  formatOnlyPath = `./${formatOnlyPath}`;
1288
1305
  }
1289
- resolveAlias['use-intl/format-message'] = formatOnlyPath;
1306
+ resolveAlias['use-intl/format-message'] = normalizeTurbopackAliasPath(formatOnlyPath);
1290
1307
  }
1291
1308
 
1292
1309
  // Add loaders
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var plugin = require('./plugin-CCD2rOD7.cjs');
3
+ var plugin = require('./plugin-YzBhQjAo.cjs');
4
4
  require('fs/promises');
5
5
  require('path');
6
6
  require('@parcel/watcher');
@@ -0,0 +1,10 @@
1
+ // Avoid rollup's `replace` plugin to compile this away
2
+ const nodeEnvKey = 'NODE_ENV'.trim();
3
+
4
+ // We avoid reading `argv.includes('dev')` related to
5
+ // https://github.com/amannn/next-intl/issues/2006
6
+ const isDevelopment = process.env[nodeEnvKey] === 'development';
7
+ const isNextBuild = process.argv.includes('build');
8
+ const isDevelopmentOrNextBuild = isDevelopment || isNextBuild;
9
+
10
+ export { isDevelopment, isDevelopmentOrNextBuild, isNextBuild };
@@ -1,4 +1,5 @@
1
1
  import ExtractionCompiler from '../../extractor/ExtractionCompiler.js';
2
+ import { isDevelopment, isNextBuild } from '../config.js';
2
3
  import { once } from '../utils.js';
3
4
 
4
5
  // Single compiler instance, initialized once per process
@@ -10,9 +11,6 @@ function initExtractionCompiler(pluginConfig) {
10
11
  return;
11
12
  }
12
13
 
13
- // Avoid rollup's `replace` plugin to compile this away
14
- const isDevelopment = process.env['NODE_ENV'.trim()] === 'development';
15
-
16
14
  // Avoid running for:
17
15
  // - info
18
16
  // - start
@@ -25,7 +23,7 @@ function initExtractionCompiler(pluginConfig) {
25
23
  // What remains are:
26
24
  // - dev (NODE_ENV=development)
27
25
  // - build (NODE_ENV=production)
28
- const shouldRun = isDevelopment || process.argv.includes('build');
26
+ const shouldRun = isDevelopment || isNextBuild;
29
27
  if (!shouldRun) return;
30
28
  runOnce(() => {
31
29
  const extractorConfig = {
@@ -3,6 +3,7 @@ import { createRequire } from 'module';
3
3
  import path from 'path';
4
4
  import { getFormatExtension } from '../extractor/format/index.js';
5
5
  import SourceFileFilter from '../extractor/source/SourceFileFilter.js';
6
+ import { isDevelopmentOrNextBuild } from './config.js';
6
7
  import { isNextJs16OrHigher, hasStableTurboConfig } from './nextFlags.js';
7
8
  import { throwError } from './utils.js';
8
9
 
@@ -10,6 +11,11 @@ const require$1 = createRequire(import.meta.url);
10
11
  function withExtensions(localPath) {
11
12
  return [`${localPath}.ts`, `${localPath}.tsx`, `${localPath}.js`, `${localPath}.jsx`];
12
13
  }
14
+ function normalizeTurbopackAliasPath(pathname) {
15
+ // Turbopack alias targets should use forward slashes; Windows backslashes can
16
+ // break resolution in dev (see `next-intl/config` alias path style).
17
+ return pathname.replace(/\\/g, '/');
18
+ }
13
19
  function resolveI18nPath(providedPath, cwd) {
14
20
  function resolvePath(pathname) {
15
21
  const parts = [];
@@ -21,7 +27,10 @@ function resolveI18nPath(providedPath, cwd) {
21
27
  return fs.existsSync(resolvePath(pathname));
22
28
  }
23
29
  if (providedPath) {
24
- if (!pathExists(providedPath)) {
30
+ // We use the `isNextDevOrBuild` condition to avoid throwing errors
31
+ // if `next.config.ts` is read by a non-Next.js process.
32
+ // https://github.com/amannn/next-intl/discussions/2209#discussioncomment-15650927
33
+ if (isDevelopmentOrNextBuild && !pathExists(providedPath)) {
25
34
  throwError(`Could not find i18n config at ${providedPath}, please provide a valid path.`);
26
35
  }
27
36
  return providedPath;
@@ -31,13 +40,16 @@ function resolveI18nPath(providedPath, cwd) {
31
40
  return candidate;
32
41
  }
33
42
  }
34
- throwError(`Could not locate request configuration module.\n\nThis path is supported by default: ./(src/)i18n/request.{js,jsx,ts,tsx}\n\nAlternatively, you can specify a custom location in your Next.js config:\n\nconst withNextIntl = createNextIntlPlugin(
35
-
36
- Alternatively, you can specify a custom location in your Next.js config:
43
+ if (isDevelopmentOrNextBuild) {
44
+ throwError(`Could not locate request configuration module.\n\nThis path is supported by default: ./(src/)i18n/request.{js,jsx,ts,tsx}\n\nAlternatively, you can specify a custom location in your Next.js config:\n\nconst withNextIntl = createNextIntlPlugin(\n './path/to/i18n/request.tsx'\n);`);
45
+ }
37
46
 
38
- const withNextIntl = createNextIntlPlugin(
39
- './path/to/i18n/request.tsx'
40
- );`);
47
+ // Default as fallback
48
+ if (pathExists('./src')) {
49
+ return './src/i18n/request.ts';
50
+ } else {
51
+ return './i18n/request.ts';
52
+ }
41
53
  }
42
54
  }
43
55
  function getNextConfig(pluginConfig, nextConfig) {
@@ -123,7 +135,7 @@ function getNextConfig(pluginConfig, nextConfig) {
123
135
  if (!formatOnlyPath.startsWith('.')) {
124
136
  formatOnlyPath = `./${formatOnlyPath}`;
125
137
  }
126
- resolveAlias['use-intl/format-message'] = formatOnlyPath;
138
+ resolveAlias['use-intl/format-message'] = normalizeTurbopackAliasPath(formatOnlyPath);
127
139
  }
128
140
 
129
141
  // Add loaders
@@ -0,0 +1 @@
1
+ const e="NODE_ENV".trim(),s="development"===process.env[e],o=process.argv.includes("build"),r=s||o;export{s as isDevelopment,r as isDevelopmentOrNextBuild,o as isNextBuild};
@@ -1 +1 @@
1
- import e from"../../extractor/ExtractionCompiler.js";import{once as o}from"../utils.js";let s;const t=o("_NEXT_INTL_EXTRACT");function r(o){const r=o.experimental;if(!r?.extract)return;const c="development"===process.env["NODE_ENV".trim()];(c||process.argv.includes("build"))&&t((()=>{const o={srcPath:r.srcPath,sourceLocale:r.extract.sourceLocale,messages:r.messages};function t(){s&&(s[Symbol.dispose](),s=void 0)}s=new e(o,{isDevelopment:c,projectRoot:process.cwd()}),s.extractAll(),process.on("exit",t),process.on("SIGINT",t),process.on("SIGTERM",t)}))}export{r as default};
1
+ import o from"../../extractor/ExtractionCompiler.js";import{isDevelopment as e,isNextBuild as t}from"../config.js";import{once as s}from"../utils.js";let r;const c=s("_NEXT_INTL_EXTRACT");function n(s){const n=s.experimental;if(!n?.extract)return;(e||t)&&c((()=>{const t={srcPath:n.srcPath,sourceLocale:n.extract.sourceLocale,messages:n.messages};function s(){r&&(r[Symbol.dispose](),r=void 0)}r=new o(t,{isDevelopment:e,projectRoot:process.cwd()}),r.extractAll(),process.on("exit",s),process.on("SIGINT",s),process.on("SIGTERM",s)}))}export{n as default};
@@ -1 +1 @@
1
- import e from"fs";import{createRequire as t}from"module";import s from"path";import{getFormatExtension as r}from"../extractor/format/index.js";import n from"../extractor/source/SourceFileFilter.js";import{isNextJs16OrHigher as o,hasStableTurboConfig as a}from"./nextFlags.js";import{throwError as i}from"./utils.js";const l=t(import.meta.url);function u(e){return[`${e}.ts`,`${e}.tsx`,`${e}.js`,`${e}.jsx`]}function c(t,r){function n(t){return e.existsSync(function(e){const t=[];return r&&t.push(r),t.push(e),s.resolve(...t)}(t))}if(t)return n(t)||i(`Could not find i18n config at ${t}, please provide a valid path.`),t;for(const e of[...u("./i18n/request"),...u("./src/i18n/request")])if(n(e))return e;i("Could not locate request configuration module.\n\nThis path is supported by default: ./(src/)i18n/request.{js,jsx,ts,tsx}\n\nAlternatively, you can specify a custom location in your Next.js config:\n\nconst withNextIntl = createNextIntlPlugin(\n\nAlternatively, you can specify a custom location in your Next.js config:\n\nconst withNextIntl = createNextIntlPlugin(\n './path/to/i18n/request.tsx'\n);")}function m(e,t){const u=null!=process.env.TURBOPACK,m=u||o(),p={};function x(){const t=e.experimental;return t.srcPath&&e.experimental?.messages||i("`srcPath` and `messages` are required when using `extractor`."),{loader:"next-intl/extractor/extractionLoader",options:{srcPath:t.srcPath,sourceLocale:t.extract.sourceLocale,messages:e.experimental.messages}}}function f(){return{loader:"next-intl/extractor/catalogLoader",options:{messages:e.experimental.messages}}}function g(){return t?.turbopack?.rules||t?.experimental?.turbo?.rules||{}}function d(e,t,s){e[t]?Array.isArray(e[t])?e[t].push(s):e[t]=[e[t],s]:e[t]=s}if(e.experimental?.messages){const t=e.experimental.messages;t.format||i("`format` is required when using `messages`."),t.path||i("`path` is required when using `messages`.")}if(m){e.requestConfig&&s.isAbsolute(e.requestConfig)&&i("Turbopack support for next-intl currently does not support absolute paths, please provide a relative one (e.g. './src/i18n/config.ts').\n\nFound: "+e.requestConfig);const u={"next-intl/config":c(e.requestConfig)};if(e.experimental?.messages?.precompile){let e=s.relative(process.cwd(),l.resolve("use-intl/format-message/format-only"));e.startsWith(".")||(e=`./${e}`),u["use-intl/format-message"]=e}let m;if(e.experimental?.extract){o()||i("Message extraction requires Next.js 16 or higher."),m??=g();const t=(Array.isArray(e.experimental.srcPath)?e.experimental.srcPath:[e.experimental.srcPath]).map((e=>e.endsWith("/")?e.slice(0,-1):e));d(m,`*.{${n.EXTENSIONS.join(",")}}`,{loaders:[x()],condition:{path:`{${t.join(",")}}/**/*`,content:/(useExtracted|getExtracted)/}})}if(e.experimental?.messages){o()||i("Message catalog loading requires Next.js 16 or higher."),m??=g();d(m,`*${r(e.experimental.messages.format)}`,{loaders:[f()],condition:{path:`${e.experimental.messages.path}/**/*`},as:"*.js"})}a()&&!t?.experimental?.turbo?p.turbopack={...t?.turbopack,...m&&{rules:m},resolveAlias:{...t?.turbopack?.resolveAlias,...u}}:p.experimental={...t?.experimental,turbo:{...t?.experimental?.turbo,...m&&{rules:m},resolveAlias:{...t?.experimental?.turbo?.resolveAlias,...u}}}}return u||(p.webpack=function(o,a){if(o.resolve||(o.resolve={}),o.resolve.alias||(o.resolve.alias={}),o.resolve.alias["next-intl/config"]=s.resolve(o.context,c(e.requestConfig,o.context)),e.experimental?.messages?.precompile&&(o.resolve.alias["use-intl/format-message"]=l.resolve("use-intl/format-message/format-only")),e.experimental?.extract){o.module||(o.module={}),o.module.rules||(o.module.rules=[]);const t=e.experimental.srcPath;o.module.rules.push({test:new RegExp(`\\.(${n.EXTENSIONS.join("|")})$`),include:Array.isArray(t)?t.map((e=>s.resolve(o.context,e))):s.resolve(o.context,t||""),use:[x()]})}if(e.experimental?.messages){o.module||(o.module={}),o.module.rules||(o.module.rules=[]);const t=r(e.experimental.messages.format);o.module.rules.push({test:new RegExp(`${t.replace(/\./g,"\\.")}$`),include:s.resolve(o.context,e.experimental.messages.path),use:[f()],type:"javascript/auto"})}return"function"==typeof t?.webpack?t.webpack(o,a):o}),t?.trailingSlash&&(p.env={...t.env,_next_intl_trailing_slash:"true"}),Object.assign({},t,p)}export{m as default};
1
+ import e from"fs";import{createRequire as t}from"module";import s from"path";import{getFormatExtension as r}from"../extractor/format/index.js";import o from"../extractor/source/SourceFileFilter.js";import{isDevelopmentOrNextBuild as n}from"./config.js";import{isNextJs16OrHigher as a,hasStableTurboConfig as i}from"./nextFlags.js";import{throwError as l}from"./utils.js";const u=t(import.meta.url);function c(e){return[`${e}.ts`,`${e}.tsx`,`${e}.js`,`${e}.jsx`]}function m(t,r){function o(t){return e.existsSync(function(e){const t=[];return r&&t.push(r),t.push(e),s.resolve(...t)}(t))}if(t)return n&&!o(t)&&l(`Could not find i18n config at ${t}, please provide a valid path.`),t;for(const e of[...c("./i18n/request"),...c("./src/i18n/request")])if(o(e))return e;return n&&l("Could not locate request configuration module.\n\nThis path is supported by default: ./(src/)i18n/request.{js,jsx,ts,tsx}\n\nAlternatively, you can specify a custom location in your Next.js config:\n\nconst withNextIntl = createNextIntlPlugin(\n './path/to/i18n/request.tsx'\n);"),o("./src")?"./src/i18n/request.ts":"./i18n/request.ts"}function p(e,t){const n=null!=process.env.TURBOPACK,c=n||a(),p={};function x(){const t=e.experimental;return t.srcPath&&e.experimental?.messages||l("`srcPath` and `messages` are required when using `extractor`."),{loader:"next-intl/extractor/extractionLoader",options:{srcPath:t.srcPath,sourceLocale:t.extract.sourceLocale,messages:e.experimental.messages}}}function f(){return{loader:"next-intl/extractor/catalogLoader",options:{messages:e.experimental.messages}}}function g(){return t?.turbopack?.rules||t?.experimental?.turbo?.rules||{}}function d(e,t,s){e[t]?Array.isArray(e[t])?e[t].push(s):e[t]=[e[t],s]:e[t]=s}if(e.experimental?.messages){const t=e.experimental.messages;t.format||l("`format` is required when using `messages`."),t.path||l("`path` is required when using `messages`.")}if(c){e.requestConfig&&s.isAbsolute(e.requestConfig)&&l("Turbopack support for next-intl currently does not support absolute paths, please provide a relative one (e.g. './src/i18n/config.ts').\n\nFound: "+e.requestConfig);const n={"next-intl/config":m(e.requestConfig)};if(e.experimental?.messages?.precompile){let e=s.relative(process.cwd(),u.resolve("use-intl/format-message/format-only"));e.startsWith(".")||(e=`./${e}`),n["use-intl/format-message"]=e.replace(/\\/g,"/")}let c;if(e.experimental?.extract){a()||l("Message extraction requires Next.js 16 or higher."),c??=g();const t=(Array.isArray(e.experimental.srcPath)?e.experimental.srcPath:[e.experimental.srcPath]).map((e=>e.endsWith("/")?e.slice(0,-1):e));d(c,`*.{${o.EXTENSIONS.join(",")}}`,{loaders:[x()],condition:{path:`{${t.join(",")}}/**/*`,content:/(useExtracted|getExtracted)/}})}if(e.experimental?.messages){a()||l("Message catalog loading requires Next.js 16 or higher."),c??=g();d(c,`*${r(e.experimental.messages.format)}`,{loaders:[f()],condition:{path:`${e.experimental.messages.path}/**/*`},as:"*.js"})}i()&&!t?.experimental?.turbo?p.turbopack={...t?.turbopack,...c&&{rules:c},resolveAlias:{...t?.turbopack?.resolveAlias,...n}}:p.experimental={...t?.experimental,turbo:{...t?.experimental?.turbo,...c&&{rules:c},resolveAlias:{...t?.experimental?.turbo?.resolveAlias,...n}}}}return n||(p.webpack=function(n,a){if(n.resolve||(n.resolve={}),n.resolve.alias||(n.resolve.alias={}),n.resolve.alias["next-intl/config"]=s.resolve(n.context,m(e.requestConfig,n.context)),e.experimental?.messages?.precompile&&(n.resolve.alias["use-intl/format-message"]=u.resolve("use-intl/format-message/format-only")),e.experimental?.extract){n.module||(n.module={}),n.module.rules||(n.module.rules=[]);const t=e.experimental.srcPath;n.module.rules.push({test:new RegExp(`\\.(${o.EXTENSIONS.join("|")})$`),include:Array.isArray(t)?t.map((e=>s.resolve(n.context,e))):s.resolve(n.context,t||""),use:[x()]})}if(e.experimental?.messages){n.module||(n.module={}),n.module.rules||(n.module.rules=[]);const t=r(e.experimental.messages.format);n.module.rules.push({test:new RegExp(`${t.replace(/\./g,"\\.")}$`),include:s.resolve(n.context,e.experimental.messages.path),use:[f()],type:"javascript/auto"})}return"function"==typeof t?.webpack?t.webpack(n,a):n}),t?.trailingSlash&&(p.env={...t.env,_next_intl_trailing_slash:"true"}),Object.assign({},t,p)}export{p as default};
@@ -0,0 +1,3 @@
1
+ export declare const isDevelopment: boolean;
2
+ export declare const isNextBuild: boolean;
3
+ export declare const isDevelopmentOrNextBuild: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-intl",
3
- "version": "4.8.0",
3
+ "version": "4.8.2",
4
4
  "sideEffects": false,
5
5
  "author": "Jan Amann <jan@amann.work>",
6
6
  "funding": [
@@ -127,11 +127,11 @@
127
127
  "@formatjs/intl-localematcher": "^0.5.4",
128
128
  "@parcel/watcher": "^2.4.1",
129
129
  "@swc/core": "^1.15.2",
130
- "icu-minify": "^4.8.0",
130
+ "icu-minify": "^4.8.2",
131
131
  "negotiator": "^1.0.0",
132
- "next-intl-swc-plugin-extractor": "^4.8.0",
132
+ "next-intl-swc-plugin-extractor": "^4.8.2",
133
133
  "po-parser": "^2.1.1",
134
- "use-intl": "^4.8.0"
134
+ "use-intl": "^4.8.2"
135
135
  },
136
136
  "peerDependencies": {
137
137
  "next": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0",
@@ -143,5 +143,5 @@
143
143
  "optional": true
144
144
  }
145
145
  },
146
- "gitHead": "f0795147d23f2addec96b08f03846d823fcc269e"
146
+ "gitHead": "de4baeb465185133923b69c8da36457c9418d781"
147
147
  }