@intlayer/docs 8.12.2 → 8.12.4-canary.0

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.
Files changed (73) hide show
  1. package/dist/cjs/blog.cjs.map +1 -1
  2. package/dist/cjs/common.cjs.map +1 -1
  3. package/dist/cjs/doc.cjs.map +1 -1
  4. package/dist/cjs/frequentQuestions.cjs.map +1 -1
  5. package/dist/cjs/generated/blog.entry.cjs +1 -0
  6. package/dist/cjs/generated/blog.entry.cjs.map +1 -1
  7. package/dist/cjs/generated/docs.entry.cjs +1 -0
  8. package/dist/cjs/generated/docs.entry.cjs.map +1 -1
  9. package/dist/cjs/generated/frequentQuestions.entry.cjs +1 -0
  10. package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
  11. package/dist/cjs/generated/legal.entry.cjs +1 -0
  12. package/dist/cjs/generated/legal.entry.cjs.map +1 -1
  13. package/dist/cjs/legal.cjs.map +1 -1
  14. package/dist/esm/blog.mjs.map +1 -1
  15. package/dist/esm/common.mjs.map +1 -1
  16. package/dist/esm/doc.mjs.map +1 -1
  17. package/dist/esm/frequentQuestions.mjs.map +1 -1
  18. package/dist/esm/generated/blog.entry.mjs.map +1 -1
  19. package/dist/esm/generated/docs.entry.mjs.map +1 -1
  20. package/dist/esm/generated/frequentQuestions.entry.mjs.map +1 -1
  21. package/dist/esm/generated/legal.entry.mjs.map +1 -1
  22. package/dist/esm/legal.mjs.map +1 -1
  23. package/dist/types/blog.d.ts.map +1 -1
  24. package/dist/types/common.d.ts.map +1 -1
  25. package/dist/types/doc.d.ts.map +1 -1
  26. package/dist/types/frequentQuestions.d.ts.map +1 -1
  27. package/dist/types/legal.d.ts.map +1 -1
  28. package/docs/ar/bundle_optimization.md +250 -102
  29. package/docs/ar/configuration.md +10 -10
  30. package/docs/bn/bundle_optimization.md +252 -104
  31. package/docs/bn/configuration.md +10 -10
  32. package/docs/cs/bundle_optimization.md +253 -105
  33. package/docs/cs/configuration.md +10 -10
  34. package/docs/de/bundle_optimization.md +245 -97
  35. package/docs/de/configuration.md +10 -10
  36. package/docs/en/bundle_optimization.md +172 -49
  37. package/docs/en/configuration.md +10 -10
  38. package/docs/en-GB/bundle_optimization.md +230 -82
  39. package/docs/en-GB/configuration.md +10 -10
  40. package/docs/es/bundle_optimization.md +250 -102
  41. package/docs/es/configuration.md +10 -10
  42. package/docs/fr/bundle_optimization.md +223 -75
  43. package/docs/fr/configuration.md +10 -10
  44. package/docs/hi/bundle_optimization.md +253 -105
  45. package/docs/hi/configuration.md +10 -10
  46. package/docs/id/bundle_optimization.md +258 -110
  47. package/docs/id/configuration.md +10 -10
  48. package/docs/it/bundle_optimization.md +249 -103
  49. package/docs/it/configuration.md +10 -10
  50. package/docs/ja/bundle_optimization.md +245 -97
  51. package/docs/ja/configuration.md +10 -10
  52. package/docs/ko/bundle_optimization.md +253 -105
  53. package/docs/ko/configuration.md +10 -10
  54. package/docs/nl/bundle_optimization.md +249 -101
  55. package/docs/nl/configuration.md +10 -10
  56. package/docs/pl/bundle_optimization.md +258 -111
  57. package/docs/pl/configuration.md +10 -10
  58. package/docs/pt/bundle_optimization.md +256 -115
  59. package/docs/pt/configuration.md +10 -10
  60. package/docs/ru/bundle_optimization.md +253 -105
  61. package/docs/ru/configuration.md +10 -10
  62. package/docs/tr/bundle_optimization.md +255 -107
  63. package/docs/tr/configuration.md +10 -10
  64. package/docs/uk/bundle_optimization.md +250 -102
  65. package/docs/uk/configuration.md +10 -10
  66. package/docs/ur/bundle_optimization.md +257 -109
  67. package/docs/ur/configuration.md +10 -10
  68. package/docs/vi/bundle_optimization.md +259 -111
  69. package/docs/vi/configuration.md +10 -10
  70. package/docs/zh/bundle_optimization.md +260 -112
  71. package/docs/zh/configuration.md +10 -10
  72. package/docs/zh-TW/bundle_optimization.md +602 -0
  73. package/package.json +8 -8
@@ -682,16 +682,16 @@ routing: {
682
682
 
683
683
  Wenn Sie Cookie-Speicherung verwenden, können Sie zusätzliche Cookie-Attribute konfigurieren:
684
684
 
685
- | Feld | Beschreibung | Typ |
686
- | ---------- | --------------------------------------------------------------------------------------- | ----------------------------------------------------- |
687
- | `name` | Cookie-Name. Standard: `'INTLAYER_LOCALE'` | `string` |
688
- | `domain` | Cookie-Domain. Standard: `undefined` | `string` |
689
- | `path` | Cookie-Pfad. Standard: `undefined` | `string` |
690
- | `secure` | HTTPS erforderlich. Standard: `undefined` | `boolean` |
691
- | `httpOnly` | HTTP-only Flag. Standard: `undefined` | `boolean` |
692
- | `sameSite` | SameSite-Richtlinie. | `'strict'` &#124; <br/> `'lax'` &#124; <br/> `'none'` |
693
- | `expires` | Ablaufdatum oder Tage. Standard: `undefined` | `Date` &#124; <br/> `number` |
694
- | `maxAge` | Lebensdauer in Sekunden ab Erstellung. Hat Vorrang vor `expires`. Standard: `undefined` | `number` |
685
+ | Feld | Beschreibung | Typ |
686
+ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------- |
687
+ | `name` | Cookie-Name. Standard: `'INTLAYER_LOCALE'` | `string` |
688
+ | `domain` | Cookie-Domain. Standard: `undefined` | `string` |
689
+ | `path` | Cookie-Pfad. Standard: `undefined` | `string` |
690
+ | `secure` | HTTPS erforderlich. Standard: `undefined` | `boolean` |
691
+ | `httpOnly` | HTTP-only Flag. Standard: `undefined` | `boolean` |
692
+ | `sameSite` | SameSite-Richtlinie. | `'strict'` &#124; <br/> `'lax'` &#124; <br/> `'none'` |
693
+ | `expires` | Eine Zahl steht für Tage seit der Erstellung; ein Datum (oder ISO-Datumsstring) ist ein absolutes Ablaufdatum. Standard: `undefined` | `Date` &#124; <br/> `number` &#124; <br/> `string` |
694
+ | `maxAge` | Lebensdauer in Sekunden ab Erstellung. Hat Vorrang vor `expires`. Standard: `undefined` | `number` |
695
695
 
696
696
  #### Sprachspeicher-Attribute
697
697
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2025-11-25
3
- updatedAt: 2026-04-08
3
+ updatedAt: 2026-06-07
4
4
  title: Optimizing i18n Bundle Size & Performance
5
5
  description: Reduce application bundle size by optimizing internationalization (i18n) content. Learn how to leverage tree shaking and lazy loading for dictionaries with Intlayer.
6
6
  keywords:
@@ -16,6 +16,9 @@ slugs:
16
16
  - concept
17
17
  - bundle-optimization
18
18
  history:
19
+ - version: 8.12.0
20
+ date: 2026-06-07
21
+ changes: "Add `intlayerPurgeBabelPlugin` and `intlayerMinifyBabelPlugin` for Babel/Webpack; clarify plugin pipeline"
19
22
  - version: 8.7.0
20
23
  date: 2026-04-08
21
24
  changes: "Add `minify` and `purge` options to the build configuration"
@@ -170,15 +173,52 @@ export default {
170
173
 
171
174
  Intlayer uses a **per-component approach**. Unlike global JSON files, your content is defined alongside or within your components. During the build process, Intlayer:
172
175
 
173
- 1. **Analyzes** your code to find `useIntlayer` calls.
174
- 2. **Builds** the corresponding dictionary content.
175
- 3. **Replaces** the `useIntlayer` call with optimized code based on your configuration.
176
+ 1. **Analyzes** your code to find `useIntlayer` calls.
177
+ 2. **Builds** the corresponding dictionary content.
178
+ 3. **Replaces** the `useIntlayer` call with optimized code based on your configuration.
176
179
 
177
180
  This ensures that:
178
181
 
179
182
  - If a component is not imported, its content is not included in the bundle (Dead Code Elimination).
180
183
  - If a component is lazy-loaded, its content is also lazy-loaded.
181
184
 
185
+ ## Plugin Reference
186
+
187
+ Intlayer's build optimization is split across several discrete plugins, each with a single responsibility. Understanding what each one does prevents confusion when wiring them up.
188
+
189
+ ### Babel plugins (`@intlayer/babel`)
190
+
191
+ These are used directly in `babel.config.js` for Webpack-based setups (Next.js with Babel, CRA, custom Webpack, etc.).
192
+
193
+ | Plugin | What it does |
194
+ | :---------------------------- | :------------------------------------------------------------------------------------------------------------- |
195
+ | `intlayerExtractBabelPlugin` | Scans `.content.ts` files and writes compiled dictionaries to `.intlayer/` |
196
+ | `intlayerOptimizeBabelPlugin` | Rewrites `useIntlayer('key')` → `useDictionary(hash)` and injects the matching dictionary `import` |
197
+ | `intlayerPurgeBabelPlugin` | Scans all source files, removes **unused content fields** from compiled `.intlayer/**/*.json` dictionary files |
198
+ | `intlayerMinifyBabelPlugin` | **Renames content field keys** to short alphabetic aliases (`title` → `a`) in both JSON files and source code |
199
+
200
+ > **Plugin order matters.** In your `babel.config.js` the purge and minify plugins must appear **before** the optimize plugin. The optimize pass replaces `useIntlayer('key')` with an opaque `useDictionary(hash)` call, erasing the dictionary-key information that the purge and minify passes need to identify which fields are used.
201
+
202
+ Each Babel plugin has a matching options helper that reads your `intlayer.config.ts` once at config-load time and returns pre-resolved values:
203
+
204
+ | Options helper | Used with |
205
+ | :--------------------------- | :---------------------------- |
206
+ | `getExtractPluginOptions()` | `intlayerExtractBabelPlugin` |
207
+ | `getOptimizePluginOptions()` | `intlayerOptimizeBabelPlugin` |
208
+ | `getPurgePluginOptions()` | `intlayerPurgeBabelPlugin` |
209
+ | `getMinifyPluginOptions()` | `intlayerMinifyBabelPlugin` |
210
+
211
+ ### Vite plugins (`vite-intlayer`)
212
+
213
+ Vite users **never configure these directly**. They are wired up automatically when you call `withIntlayer()` in `vite.config.ts`. The `build.purge` and `build.minify` flags in `intlayer.config.ts` toggle the corresponding behaviour without any extra plugin registration.
214
+
215
+ | Internal Vite plugin | Equivalent behaviour |
216
+ | :------------------- | :------------------------------------------------------------------------------------- |
217
+ | Usage analyzer | Same as `intlayerPurgeBabelPlugin` analysis pass |
218
+ | Dictionary prune | Same as `intlayerPurgeBabelPlugin` JSON-write pass |
219
+ | Dictionary minify | Same as `intlayerMinifyBabelPlugin` JSON-write pass |
220
+ | Babel transform | Same as `intlayerMinifyBabelPlugin` source-code rename + `intlayerOptimizeBabelPlugin` |
221
+
182
222
  ## Setup by Platform
183
223
 
184
224
  <Tabs>
@@ -186,7 +226,7 @@ This ensures that:
186
226
 
187
227
  ### Next.js
188
228
 
189
- Next.js requires the `@intlayer/swc` plugin to handle the transformation, as Next.js uses SWC for builds.
229
+ Next.js requires the `@intlayer/swc` plugin for the optimize (import rewriting) pass, because Next.js uses SWC for builds.
190
230
 
191
231
  > This plugin is not installed by default because SWC plugins are still experimental for Next.js. It may change in the future.
192
232
 
@@ -206,21 +246,63 @@ pnpm add -D @intlayer/swc
206
246
  bun add -d @intlayer/swc
207
247
  ```
208
248
 
209
- Once Installed. Intlayer will automatically detect and use the plugin.
249
+ Once installed, Intlayer will automatically detect and use the plugin.
250
+
251
+ For the **purge and minify** passes (field removal and field renaming), install `@intlayer/babel` alongside and add the Babel plugins. Because Next.js uses SWC for transform but still evaluates `babel.config.js` for plugin configuration, the Babel plugins run as a pre-pass before SWC.
252
+
253
+ ```bash packageManager="npm"
254
+ npm install -D @intlayer/babel
255
+ ```
256
+
257
+ ```javascript fileName="babel.config.js"
258
+ const {
259
+ intlayerPurgeBabelPlugin,
260
+ intlayerMinifyBabelPlugin,
261
+ getPurgePluginOptions,
262
+ getMinifyPluginOptions,
263
+ } = require("@intlayer/babel");
264
+
265
+ module.exports = {
266
+ presets: ["next/babel"],
267
+ plugins: [
268
+ // Purge: remove unused content fields from .intlayer/**/*.json
269
+ [intlayerPurgeBabelPlugin, getPurgePluginOptions()],
270
+ // Minify: rename content field keys in JSON + source code
271
+ [intlayerMinifyBabelPlugin, getMinifyPluginOptions()],
272
+ // Note: intlayerOptimizeBabelPlugin is NOT needed here because
273
+ // @intlayer/swc handles the useIntlayer → useDictionary rewrite.
274
+ ],
275
+ };
276
+ ```
210
277
 
211
278
  </Tab>
212
279
  <Tab value="vite">
213
280
 
214
281
  ### Vite
215
282
 
216
- Vite uses `@intlayer/babel` plugin which is included as dependency of `vite-intlayer`. The optimization is enabled by default. Nothing else to do.
283
+ Vite uses the `@intlayer/babel` plugin, which is included as a dependency of `vite-intlayer`. The full optimization pipeline — import rewriting, purge, and minify — is enabled by default and requires no extra plugin registration.
284
+
285
+ Enable purge and minify by setting the corresponding flags in `intlayer.config.ts`:
286
+
287
+ ```typescript fileName="intlayer.config.ts"
288
+ import type { IntlayerConfig } from "intlayer";
289
+
290
+ const config: IntlayerConfig = {
291
+ build: {
292
+ purge: true, // remove unused content fields from bundled JSON
293
+ minify: true, // rename content field keys to short aliases
294
+ },
295
+ };
296
+
297
+ export default config;
298
+ ```
217
299
 
218
300
  </Tab>
219
301
  <Tab value="webpack">
220
302
 
221
- ### Webpack
303
+ ### Webpack (and Next.js with Babel)
222
304
 
223
- To enable bundle optimization with Intlayer on Webpack, you need to install and configure the appropriate Babel (`@intlayer/babel`) or SWC (`@intlayer/swc`) plugin.
305
+ Install `@intlayer/babel`:
224
306
 
225
307
  ```bash packageManager="npm"
226
308
  npm install -D @intlayer/babel
@@ -238,14 +320,37 @@ pnpm add -D @intlayer/babel
238
320
  bun add -d @intlayer/babel
239
321
  ```
240
322
 
241
- ```typescript fileName="babel.config.js"
323
+ Add all four plugins to `babel.config.js` in the correct order:
324
+
325
+ ```javascript fileName="babel.config.js"
242
326
  const {
243
- getOptimizePluginOptions,
327
+ intlayerExtractBabelPlugin,
328
+ intlayerPurgeBabelPlugin,
329
+ intlayerMinifyBabelPlugin,
244
330
  intlayerOptimizeBabelPlugin,
331
+ getExtractPluginOptions,
332
+ getPurgePluginOptions,
333
+ getMinifyPluginOptions,
334
+ getOptimizePluginOptions,
245
335
  } = require("@intlayer/babel");
246
336
 
247
337
  module.exports = {
248
- plugins: [[intlayerOptimizeBabelPlugin, getOptimizePluginOptions()]],
338
+ plugins: [
339
+ // Extract: compile .content.ts files → .intlayer/**/*.json
340
+ [intlayerExtractBabelPlugin, getExtractPluginOptions()],
341
+
342
+ // Purge: remove unused fields from .intlayer/**/*.json
343
+ // (reads intlayer.config.ts build.purge flag)
344
+ [intlayerPurgeBabelPlugin, getPurgePluginOptions()],
345
+
346
+ // Minify: rename field keys in JSON + source code
347
+ // (reads intlayer.config.ts build.minify flag)
348
+ [intlayerMinifyBabelPlugin, getMinifyPluginOptions()],
349
+
350
+ // Optimize: rewrite useIntlayer('key') → useDictionary(hash)
351
+ // Must come last because it erases the dictionary key.
352
+ [intlayerOptimizeBabelPlugin, getOptimizePluginOptions()],
353
+ ],
249
354
  };
250
355
  ```
251
356
 
@@ -268,43 +373,48 @@ const config: IntlayerConfig = {
268
373
  importMode: "dynamic",
269
374
  },
270
375
  build: {
271
- /**
272
- * Minify the dictionaries to reduce the bundle size.
273
- */
274
- minify: true;
275
-
276
- /**
277
- * Purge the unused keys in a dictionaries
278
- */
279
- purge: true;
280
-
281
- /**
282
- * Indicates if the build should check TypeScript types
283
- */
284
- checkTypes: false;
376
+ // Replace useIntlayer() calls with direct dictionary imports at build time.
377
+ // undefined = auto (enabled in production), true = always, false = never.
378
+ optimize: undefined,
379
+
380
+ // Rename content field keys in compiled dictionaries to short alphabetic
381
+ // aliases (e.g. title → a). Reduces JSON size; requires optimize.
382
+ minify: true,
383
+
384
+ // Remove content fields that are never accessed in source code.
385
+ // Requires optimize.
386
+ purge: true,
285
387
  },
286
388
  };
287
389
 
288
390
  export default config;
289
391
  ```
290
392
 
291
- > Keeping the default option for `optimize` is recommended in the most majority of cases.
393
+ > Keeping the default value (`undefined`) for `optimize` is recommended in most cases.
292
394
 
293
- > See doc configuration for more details: [Configuration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/configuration.md)
395
+ > See the configuration reference for all options: [Configuration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/configuration.md)
294
396
 
295
397
  ### Build Options
296
398
 
297
- The following options are available under the `build` configuration object:
399
+ | Property | Type | Default | Description |
400
+ | :------------- | :--------------------- | :---------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
401
+ | **`optimize`** | `boolean \| undefined` | `undefined` | Enables the import-rewriting pass. `undefined` = active only in production builds. `false` disables purge and minify as well. |
402
+ | **`minify`** | `boolean` | `false` | Renames content field keys in compiled JSON files to short alphabetic aliases. Also rewrites matching property accesses in source code. Has no effect when `optimize` is `false`. |
403
+ | **`purge`** | `boolean` | `false` | Removes content fields that are never statically accessed from compiled JSON files. Has no effect when `optimize` is `false`. |
298
404
 
299
- | Property | Type | Default | Description |
300
- | :------------- | :-------- | :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
301
- | **`optimize`** | `boolean` | `undefined` | Controls whether build optimization is enabled. If `true`, Intlayer replaces dictionary calls with optimized injects. If `false`, optimization is disabled. Ideally set to `true` in production. |
302
- | **`minify`** | `boolean` | `false` | Whether to minify the dictionaries to reduce the bundle size. |
303
- | **`purge`** | `boolean` | `false` | Whether to purge the unused keys in dictionaries. |
405
+ ### Minification (field key renaming)
304
406
 
305
- ### Minification
407
+ `build.minify` does **not** minify your JavaScript bundle — your bundler handles that. Instead, it shrinks the compiled dictionary JSON files by replacing every user-defined content field key with a short alphabetic alias:
408
+
409
+ ```
410
+ // Before minification
411
+ { "title": "Hello", "subtitle": "World" }
412
+
413
+ // After minification
414
+ { "a": "Hello", "b": "World" }
415
+ ```
306
416
 
307
- Minifying dictionaries removes unnecessary whitespace, comments, and reduces the size of the JSON content. This is especially useful for large dictionaries.
417
+ The same rename is applied to all property accesses in your source code, so `content.title` becomes `content.a` in the compiled output. The runtime behaviour is identical.
308
418
 
309
419
  ```typescript fileName="intlayer.config.ts"
310
420
  import type { IntlayerConfig } from "intlayer";
@@ -318,11 +428,13 @@ const config: IntlayerConfig = {
318
428
  export default config;
319
429
  ```
320
430
 
321
- > Note: Minification is ignored if `optimize` is disabled or if the Visual Editor is enabled (as the editor needs the full content to allow editing).
431
+ > Minification is skipped when `optimize` is `false` or when `editor.enabled` is `true` (the visual editor requires the original field names to allow editing).
322
432
 
323
- ### Purging
433
+ > Minification is also skipped for dictionaries loaded via `importMode: 'fetch'` because their JSON is served from a remote API using the original field names — renaming the client-side keys would break the server/client contract.
324
434
 
325
- Purging ensures that only the keys actually used in your code are included in the final dictionary bundle. This can significantly reduce the size of your bundle if you have large dictionaries with many keys that are not used in every part of your application.
435
+ ### Purging (unused field removal)
436
+
437
+ `build.purge` analyzes which content fields are actually accessed in your source code and removes all others from the compiled JSON files.
326
438
 
327
439
  ```typescript fileName="intlayer.config.ts"
328
440
  import type { IntlayerConfig } from "intlayer";
@@ -336,7 +448,19 @@ const config: IntlayerConfig = {
336
448
  export default config;
337
449
  ```
338
450
 
339
- > Note: Purging is ignored if `optimize` is disabled.
451
+ **Example:** a dictionary with five fields where only two are used:
452
+
453
+ ```
454
+ // Before purge
455
+ { "title": "…", "subtitle": "…", "cta": "…", "footer": "…", "badge": "…" }
456
+
457
+ // After purge (only title + subtitle accessed in source)
458
+ { "title": "…", "subtitle": "…" }
459
+ ```
460
+
461
+ > Purge is skipped when `optimize` is `false` or when `editor.enabled` is `true`.
462
+
463
+ > Purge is also skipped conservatively when a source file cannot be parsed, or when the result of `useIntlayer` is assigned to a variable and passed around in ways the static analyser cannot follow (e.g. spread into an object, passed as a prop without destructuring). In those cases the full dictionary is kept.
340
464
 
341
465
  ### Import Mode
342
466
 
@@ -344,7 +468,7 @@ For large applications, including several pages and locales, your JSON can repre
344
468
 
345
469
  ### Global definition
346
470
 
347
- The import mode can be defined by default globally in your `intlayer.config.ts` file.
471
+ The import mode can be defined globally in your `intlayer.config.ts` file.
348
472
 
349
473
  ```typescript fileName="intlayer.config.ts"
350
474
  import type { IntlayerConfig } from "intlayer";
@@ -358,9 +482,9 @@ const config: IntlayerConfig = {
358
482
  export default config;
359
483
  ```
360
484
 
361
- ### Per dictionary fine-grained definition
485
+ ### Per-dictionary definition
362
486
 
363
- As well as for each dictionaries in your `.content.{{ts|tsx|js|jsx|mjs|cjs|json|jsonc|json5}}` files.
487
+ You can override the import mode for individual dictionaries in their `.content.{{ts|tsx|js|jsx|mjs|cjs|json|jsonc|json5|md|mdx|yaml|yml}}` files.
364
488
 
365
489
  ```ts
366
490
  import { type Dictionary, t } from "intlayer";
@@ -376,12 +500,11 @@ const appContent: Dictionary = {
376
500
  export default appContent;
377
501
  ```
378
502
 
379
- | Property | Type | Default | Description |
380
- | :--------------- | :--------------------------------- | :--------- | :--------------------------------------------------------------------------------------------------------------- |
381
- | **`importMode`** | `'static'`, `'dynamic'`, `'fetch'` | `'static'` | **Deprecated**: Use `dictionary.importMode` instead. Determines how dictionaries are loaded (see details below). |
503
+ | Property | Type | Default | Description |
504
+ | :--------------- | :--------------------------------- | :--------- | :------------------------------------------------------------------------------------------------------- |
505
+ | **`importMode`** | `'static'`, `'dynamic'`, `'fetch'` | `'static'` | **Deprecated**: Use `dictionary.importMode` instead. Determines how dictionaries are loaded (see below). |
382
506
 
383
- The `importMode` setting dictates how the dictionary content is injected into your component.
384
- You can define it globally in the `intlayer.config.ts` file under the `dictionary` object, or you can overwrite it for a specific dictionary in its `.content.ts` file.
507
+ The `importMode` setting dictates how the dictionary content is injected into your component. You can define it globally in `intlayer.config.ts` under the `dictionary` object, or override it per dictionary in its `.content.ts` file.
385
508
 
386
509
  ### 1. Static Mode (`default`)
387
510
 
@@ -466,7 +589,7 @@ const content = useDictionaryAsync({
466
589
 
467
590
  > See CMS documentation for more details: [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_CMS.md)
468
591
 
469
- > In fetch mode, purge and minification can't be used.
592
+ > In fetch mode, purge and minification are not applied because the JSON is served from a remote API using the original field names.
470
593
 
471
594
  ## Summary: Static vs Dynamic
472
595
 
@@ -681,16 +681,16 @@ routing: {
681
681
 
682
682
  When using cookie storage, you can configure additional cookie attributes:
683
683
 
684
- | Field | Description | Type |
685
- | ---------- | --------------------------------------------- | ----------------------------------------------------- |
686
- | `name` | Cookie name. Default: `'INTLAYER_LOCALE'` | `string` |
687
- | `domain` | Cookie domain. Default: `undefined` | `string` |
688
- | `path` | Cookie path. Default: `undefined` | `string` |
689
- | `secure` | Require HTTPS. Default: `undefined` | `boolean` |
690
- | `httpOnly` | HTTP-only flag. Default: `undefined` | `boolean` |
691
- | `sameSite` | SameSite policy. | `'strict'` &#124; <br/> `'lax'` &#124; <br/> `'none'` |
692
- | `expires` | Expiration date or days. Default: `undefined` | `Date` &#124; <br/> `number` |
693
- | `maxAge` | Lifetime in seconds from creation. Takes precedence over `expires`. Default: `undefined` | `number` |
684
+ | Field | Description | Type |
685
+ | ---------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
686
+ | `name` | Cookie name. Default: `'INTLAYER_LOCALE'` | `string` |
687
+ | `domain` | Cookie domain. Default: `undefined` | `string` |
688
+ | `path` | Cookie path. Default: `undefined` | `string` |
689
+ | `secure` | Require HTTPS. Default: `undefined` | `boolean` |
690
+ | `httpOnly` | HTTP-only flag. Default: `undefined` | `boolean` |
691
+ | `sameSite` | SameSite policy. | `'strict'` &#124; <br/> `'lax'` &#124; <br/> `'none'` |
692
+ | `expires` | A `number` is days from creation; a `Date` (or ISO date string) is an absolute expiry. Default: `undefined` | `Date` &#124; <br/> `number` &#124; <br/> `string` |
693
+ | `maxAge` | Lifetime in seconds from creation. Takes precedence over `expires`. Default: `undefined` | `number` |
694
694
 
695
695
  #### Locale Storage Attributes
696
696