@intlayer/docs 8.2.3 → 8.3.0-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 (128) hide show
  1. package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -0
  2. package/dist/cjs/blog.cjs.map +1 -1
  3. package/dist/cjs/common.cjs +1 -1
  4. package/dist/cjs/common.cjs.map +1 -1
  5. package/dist/cjs/doc.cjs.map +1 -1
  6. package/dist/cjs/frequentQuestions.cjs.map +1 -1
  7. package/dist/cjs/generated/blog.entry.cjs +1 -1
  8. package/dist/cjs/generated/blog.entry.cjs.map +1 -1
  9. package/dist/cjs/generated/docs.entry.cjs +1 -1
  10. package/dist/cjs/generated/docs.entry.cjs.map +1 -1
  11. package/dist/cjs/generated/frequentQuestions.entry.cjs +1 -1
  12. package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
  13. package/dist/cjs/generated/legal.entry.cjs +1 -1
  14. package/dist/cjs/generated/legal.entry.cjs.map +1 -1
  15. package/dist/cjs/legal.cjs.map +1 -1
  16. package/dist/esm/blog.mjs.map +1 -1
  17. package/dist/esm/common.mjs +1 -1
  18. package/dist/esm/common.mjs.map +1 -1
  19. package/dist/esm/doc.mjs.map +1 -1
  20. package/dist/esm/frequentQuestions.mjs.map +1 -1
  21. package/dist/esm/generated/blog.entry.mjs.map +1 -1
  22. package/dist/esm/generated/docs.entry.mjs.map +1 -1
  23. package/dist/esm/generated/frequentQuestions.entry.mjs.map +1 -1
  24. package/dist/esm/generated/legal.entry.mjs.map +1 -1
  25. package/dist/esm/legal.mjs.map +1 -1
  26. package/dist/types/blog.d.ts +1 -1
  27. package/dist/types/common.d.ts +1 -1
  28. package/dist/types/common.d.ts.map +1 -1
  29. package/dist/types/doc.d.ts +1 -1
  30. package/dist/types/frequentQuestions.d.ts +1 -1
  31. package/dist/types/generated/blog.entry.d.ts +1 -1
  32. package/dist/types/generated/docs.entry.d.ts +1 -1
  33. package/dist/types/generated/frequentQuestions.entry.d.ts +1 -1
  34. package/dist/types/generated/legal.entry.d.ts +1 -1
  35. package/dist/types/legal.d.ts +1 -1
  36. package/docs/ar/compiler.md +73 -8
  37. package/docs/ar/configuration.md +53 -17
  38. package/docs/ar/intlayer_with_nextjs_compiler.md +13 -5
  39. package/docs/ar/intlayer_with_vite+react_compiler.md +13 -5
  40. package/docs/ar/per_locale_file.md +1 -1
  41. package/docs/de/compiler.md +74 -9
  42. package/docs/de/configuration.md +49 -13
  43. package/docs/de/intlayer_with_nextjs_compiler.md +12 -4
  44. package/docs/de/intlayer_with_vite+react_compiler.md +12 -4
  45. package/docs/de/per_locale_file.md +1 -1
  46. package/docs/en/compiler.md +79 -1
  47. package/docs/en/configuration.md +39 -1
  48. package/docs/en/intlayer_with_nextjs_compiler.md +9 -1
  49. package/docs/en/intlayer_with_vite+react_compiler.md +9 -1
  50. package/docs/en/per_locale_file.md +1 -1
  51. package/docs/en-GB/compiler.md +72 -6
  52. package/docs/en-GB/configuration.md +39 -2
  53. package/docs/en-GB/intlayer_with_nextjs_compiler.md +22 -3
  54. package/docs/en-GB/intlayer_with_vite+react_compiler.md +22 -3
  55. package/docs/en-GB/per_locale_file.md +1 -1
  56. package/docs/es/compiler.md +71 -6
  57. package/docs/es/configuration.md +52 -16
  58. package/docs/es/intlayer_with_nextjs_compiler.md +9 -1
  59. package/docs/es/intlayer_with_vite+react_compiler.md +9 -1
  60. package/docs/fr/compiler.md +69 -4
  61. package/docs/fr/configuration.md +50 -14
  62. package/docs/fr/intlayer_with_nextjs_compiler.md +9 -1
  63. package/docs/fr/intlayer_with_vite+react_compiler.md +9 -1
  64. package/docs/hi/compiler.md +74 -9
  65. package/docs/hi/configuration.md +49 -13
  66. package/docs/hi/intlayer_with_nextjs_compiler.md +15 -7
  67. package/docs/hi/intlayer_with_vite+react_compiler.md +15 -7
  68. package/docs/hi/per_locale_file.md +1 -1
  69. package/docs/id/compiler.md +73 -8
  70. package/docs/id/configuration.md +46 -10
  71. package/docs/id/intlayer_with_nextjs_compiler.md +13 -5
  72. package/docs/id/intlayer_with_vite+react_compiler.md +13 -5
  73. package/docs/id/per_locale_file.md +1 -1
  74. package/docs/it/compiler.md +73 -8
  75. package/docs/it/configuration.md +54 -18
  76. package/docs/it/intlayer_with_nextjs_compiler.md +12 -4
  77. package/docs/it/intlayer_with_vite+react_compiler.md +12 -4
  78. package/docs/it/per_locale_file.md +1 -1
  79. package/docs/ja/compiler.md +75 -10
  80. package/docs/ja/configuration.md +50 -14
  81. package/docs/ja/intlayer_with_nextjs_compiler.md +13 -5
  82. package/docs/ja/intlayer_with_vite+react_compiler.md +13 -5
  83. package/docs/ko/compiler.md +75 -10
  84. package/docs/ko/configuration.md +50 -14
  85. package/docs/ko/intlayer_with_nextjs_compiler.md +22 -3
  86. package/docs/ko/intlayer_with_vite+react_compiler.md +22 -3
  87. package/docs/pl/compiler.md +73 -8
  88. package/docs/pl/configuration.md +47 -11
  89. package/docs/pl/intlayer_with_nextjs_compiler.md +13 -5
  90. package/docs/pl/intlayer_with_vite+react_compiler.md +13 -5
  91. package/docs/pl/per_locale_file.md +1 -1
  92. package/docs/pt/compiler.md +74 -9
  93. package/docs/pt/configuration.md +50 -14
  94. package/docs/pt/intlayer_with_nextjs_compiler.md +12 -4
  95. package/docs/pt/intlayer_with_vite+react_compiler.md +12 -4
  96. package/docs/pt/per_locale_file.md +1 -1
  97. package/docs/ru/compiler.md +74 -9
  98. package/docs/ru/configuration.md +49 -13
  99. package/docs/ru/intlayer_with_nextjs_compiler.md +11 -3
  100. package/docs/ru/intlayer_with_vite+react_compiler.md +11 -3
  101. package/docs/tr/compiler.md +73 -8
  102. package/docs/tr/configuration.md +53 -17
  103. package/docs/tr/intlayer_with_nextjs_compiler.md +11 -3
  104. package/docs/tr/intlayer_with_vite+react_compiler.md +11 -3
  105. package/docs/tr/per_locale_file.md +1 -1
  106. package/docs/uk/compiler.md +74 -9
  107. package/docs/uk/configuration.md +183 -147
  108. package/docs/uk/intlayer_with_nextjs_compiler.md +13 -5
  109. package/docs/uk/intlayer_with_vite+react_compiler.md +13 -5
  110. package/docs/vi/compiler.md +75 -10
  111. package/docs/vi/configuration.md +47 -11
  112. package/docs/vi/intlayer_with_nextjs_compiler.md +14 -6
  113. package/docs/vi/intlayer_with_vite+react_compiler.md +14 -6
  114. package/docs/vi/per_locale_file.md +1 -1
  115. package/docs/zh/compiler.md +75 -10
  116. package/docs/zh/configuration.md +54 -18
  117. package/docs/zh/intlayer_with_nextjs_compiler.md +13 -5
  118. package/docs/zh/intlayer_with_vite+react_compiler.md +13 -5
  119. package/package.json +16 -16
  120. package/src/blog.ts +1 -1
  121. package/src/common.ts +2 -1
  122. package/src/doc.ts +1 -1
  123. package/src/frequentQuestions.ts +1 -1
  124. package/src/generated/blog.entry.ts +1 -1
  125. package/src/generated/docs.entry.ts +1 -1
  126. package/src/generated/frequentQuestions.entry.ts +1 -1
  127. package/src/generated/legal.entry.ts +1 -1
  128. package/src/legal.ts +1 -1
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2025-09-09
3
- updatedAt: 2026-02-25
3
+ updatedAt: 2026-03-10
4
4
  title: Intlayer Compiler | Automated Content Extraction for i18n
5
5
  description: Automate your internationalisation process with the Intlayer Compiler. Extract content directly from your components for faster, more efficient i18n in Vite, Next.js, and more.
6
6
  keywords:
@@ -20,6 +20,9 @@ slugs:
20
20
  - doc
21
21
  - compiler
22
22
  history:
23
+ - version: 8.2.0
24
+ date: 2026-03-09
25
+ changes: Update compiler options, add FilePathPattern support
23
26
  - version: 8.1.7
24
27
  date: 2026-02-25
25
28
  changes: Update compiler options
@@ -157,13 +160,12 @@ import { type IntlayerConfig, Locales } from "intlayer";
157
160
  const config: IntlayerConfig = {
158
161
  compiler: {
159
162
  /**
160
- * Indicates if the compiler should be enabled.
161
163
  * Set to 'build-only' to skip the compiler during development and speed up start times.
162
164
  */
163
165
  enabled: true,
164
166
 
165
167
  /**
166
- * Pattern to traverse the code to optimise.
168
+ * Pattern to traverse the code to optimize.
167
169
  */
168
170
  transformPattern: [
169
171
  "**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}",
@@ -171,14 +173,19 @@ const config: IntlayerConfig = {
171
173
  ],
172
174
 
173
175
  /**
174
- * Pattern to exclude from the optimisation.
176
+ * Pattern to exclude from the optimization.
175
177
  */
176
178
  excludePattern: ["**/node_modules/**"],
177
179
 
178
180
  /**
179
- * Output directory for the optimised dictionaries.
181
+ * Output directory for the optimized dictionaries.
180
182
  */
181
- outputDir: "i18n",
183
+ output: ({ key }) => `compiler/${key}.content.json`,
184
+
185
+ /**
186
+ * Inset only content in generated file, without key.
187
+ */
188
+ noMetadata: false,
182
189
 
183
190
  /**
184
191
  * Dictionary key prefix
@@ -196,6 +203,65 @@ const config: IntlayerConfig = {
196
203
  export default config;
197
204
  ```
198
205
 
206
+ ### Compiler Configuration Reference
207
+
208
+ The following properties can be configured in the `compiler` block of your `intlayer.config.ts` file:
209
+
210
+ - **enabled**:
211
+ - _Type_: `boolean | 'build-only'`
212
+ - _Default_: `true`
213
+ - _Description_: Indicates if the compiler should be enabled.
214
+ - **dictionaryKeyPrefix**:
215
+ - _Type_: `string`
216
+ - _Default_: `'comp-'`
217
+ - _Description_: Prefix for the extracted dictionary keys.
218
+ - **transformPattern**:
219
+ - _Type_: `string | string[]`
220
+ - _Default_: `['**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}', '!**/node_modules/**']`
221
+ - _Description_: Patterns to traverse the code to optimize.
222
+ - **excludePattern**:
223
+ - _Type_: `string | string[]`
224
+ - _Default_: `['**/node_modules/**']`
225
+ - _Description_: Patterns to exclude from the optimization.
226
+ - **outputDir** (Deprecated):
227
+ - _Type_: `string`
228
+ - _Default_: `'compiler'`
229
+ - _Description_: The directory where the extracted dictionaries will be stored.
230
+
231
+ - **output**:
232
+ - _Type_: `FilePathPattern`
233
+ - _Default_: `({ key }) => 'compiler/${key}.content.json'`
234
+ - _Description_: Defines the output files path. Replaces `outputDir`. Handles dynamic variables like `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{componentFormat}}`. Can be set as a string using `'my/{{var}}/path'` format, or as a function.
235
+ - _Note_: `./**/*` Path are resolved relatively to the component. `/**/*` path are resolved relatively to the Intlayer `baseDir`.
236
+ - _Example_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
237
+
238
+ - **noMetadata**:
239
+ - _Type_: `boolean`
240
+ - _Default_: `false`
241
+ - _Description_: Indicates if the metadata should be saved in the file. If true, the compiler will not save the metadata of the dictionaries (key, content wrapper).
242
+ - _Note_: Useful if used with `loadJSON` plugin.
243
+ - _Example_:
244
+ If `true`:
245
+ ```json
246
+ {
247
+ "key": "value"
248
+ }
249
+ ```
250
+ If `false`:
251
+ ```json
252
+ {
253
+ "key": "value",
254
+ "content": {
255
+ "key": "value"
256
+ }
257
+ }
258
+ ```
259
+
260
+ - **saveComponents**:
261
+ - _Type_: `boolean`
262
+ - _Default_: `false`
263
+ - _Description_: Indicates if the components should be saved after being transformed.
264
+
199
265
  ### Fill missing translation
200
266
 
201
267
  Intlayer provide a CLI tool to help you fill missing translations. You can use the `intlayer` command to test and fill missing translations from your code.
@@ -14,6 +14,9 @@ slugs:
14
14
  - concept
15
15
  - configuration
16
16
  history:
17
+ - version: 8.2.0
18
+ date: 2026-03-09
19
+ changes: Update compiler options, add 'output' and 'noMetadata' support
17
20
  - version: 8.1.7
18
21
  date: 2026-02-25
19
22
  changes: Update compiler options
@@ -439,7 +442,12 @@ const config: IntlayerConfig = {
439
442
  /**
440
443
  * Output directory for the optimized dictionaries.
441
444
  */
442
- outputDir: "compiler",
445
+ output: ({ key }) => `compiler/${key}.content.json`,
446
+
447
+ /**
448
+ * Inset only content in generated file, without key.
449
+ */
450
+ noMetadata: false,
443
451
 
444
452
  /**
445
453
  * Dictionary key prefix
@@ -704,7 +712,7 @@ Settings related to content handling within the application, including directory
704
712
  #### Properties
705
713
 
706
714
  - **autoFill**:
707
- - _Type_: `boolean | string | { [key in Locales]?: string }`
715
+ - _Type_: `boolean | string | FilePathPattern | { [key in Locales]?: string }`
708
716
  - _Default_: `undefined`
709
717
  - _Description_: Indicates how the content should be automatically filled using AI. Can be declared globally in the `intlayer.config.ts` file.
710
718
  - _Example_: true
@@ -1063,3 +1071,32 @@ Settings that control the Intlayer compiler, which extracts dictionaries straigh
1063
1071
  - _Type_: `string`
1064
1072
  - _Default_: `'compiler'`
1065
1073
  - _Description_: The directory where the extracted dictionaries will be stored, relative to your project base path.
1074
+
1075
+ - **output**:
1076
+ - _Type_: `FilePathPattern`
1077
+ - _Default_: `({ key }) => 'compiler/${key}.content.json'`
1078
+ - _Description_: Defines the output files path. Replaces `outputDir`. Handles dynamic variables like `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{componentFormat}}`. Can be set as a string using `'my/{{var}}/path'` format, or as a function.
1079
+ - _Note_: `./**/*` Path are resolved relatively to the component. `/**/*` path are resolved relatively to the Intlayer `baseDir`.
1080
+ - _Example_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
1081
+
1082
+ - **noMetadata**:
1083
+ - _Type_: `boolean`
1084
+ - _Default_: `false`
1085
+ - _Description_: Indicates if the metadata should be saved in the file. If true, the compiler will not save the metadata of the dictionaries (key, content wrapper).
1086
+ - _Note_: Useful if used with `loadJSON` plugin.
1087
+ - _Example_:
1088
+ If `true`:
1089
+ ```json
1090
+ {
1091
+ "key": "value"
1092
+ }
1093
+ ```
1094
+ If `false`:
1095
+ ```json
1096
+ {
1097
+ "key": "value",
1098
+ "content": {
1099
+ "key": "value"
1100
+ }
1101
+ }
1102
+ ```
@@ -20,6 +20,9 @@ slugs:
20
20
  applicationTemplate: https://github.com/aymericzip/intlayer-next-no-lolale-path-template
21
21
  youtubeVideo: https://www.youtube.com/watch?v=e_PPG7PTqGU
22
22
  history:
23
+ - version: 8.2.0
24
+ date: 2026-03-09
25
+ changes: Update compiler options, add FilePathPattern support
23
26
  - version: 8.1.6
24
27
  date: 2026-02-23
25
28
  changes: Initial release
@@ -127,9 +130,25 @@ const config: IntlayerConfig = {
127
130
  mode: "search-params",
128
131
  },
129
132
  compiler: {
130
- enabled: true, // Can be set to 'build-only' to limit impact on dev mode
131
- outputDir: "i18n",
132
- dictionaryKeyPrefix: "", // No prefix, default is "comp-"
133
+ /**
134
+ * Set to 'build-only' to skip the compiler during development and speed up start times.
135
+ */
136
+ enabled: true,
137
+
138
+ /**
139
+ * Output directory for the optimized dictionaries.
140
+ */
141
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
142
+
143
+ /**
144
+ * Inset only content in generated file, without key.
145
+ */
146
+ noMetadata: false,
147
+
148
+ /**
149
+ * Dictionary key prefix
150
+ */
151
+ dictionaryKeyPrefix: "", // Remove base prefix
133
152
  },
134
153
  ai: {
135
154
  provider: "openai",
@@ -19,6 +19,9 @@ slugs:
19
19
  applicationTemplate: https://github.com/aymericzip/intlayer-vite-react-template
20
20
  youtubeVideo: https://www.youtube.com/watch?v=dS9L7uJeak4
21
21
  history:
22
+ - version: 8.2.0
23
+ date: 2026-03-09
24
+ changes: Update compiler options, add FilePathPattern support
22
25
  - version: 8.1.6
23
26
  date: 2026-02-23
24
27
  changes: Initial release
@@ -124,9 +127,25 @@ const config: IntlayerConfig = {
124
127
  defaultLocale: Locales.ENGLISH,
125
128
  },
126
129
  compiler: {
127
- enabled: true, // Can be set to 'build-only' to limit impact on dev mode
128
- outputDir: "i18n",
129
- dictionaryKeyPrefix: "", // No prefix comp-
130
+ /**
131
+ * Set to 'build-only' to skip the compiler during development and speed up start times.
132
+ */
133
+ enabled: true,
134
+
135
+ /**
136
+ * Output directory for the optimized dictionaries.
137
+ */
138
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
139
+
140
+ /**
141
+ * Inset only content in generated file, without key.
142
+ */
143
+ noMetadata: false,
144
+
145
+ /**
146
+ * Dictionary key prefix
147
+ */
148
+ dictionaryKeyPrefix: "", // Remove base prefix
130
149
  },
131
150
  ai: {
132
151
  provider: "openai",
@@ -126,7 +126,7 @@ const config: IntlayerConfig = {
126
126
  export default config;
127
127
  ```
128
128
 
129
- Using this configuration, all per-locale files will be generated with the default locale set to English. It also includes generation of `.content` files using the `extract` command, and the compiler. (See [Compiler](https://intlayer.org/doc/compiler) or [Extract](https://intlayer.org/doc/concept/cli/extract) for more information.)
129
+ Using this configuration, all per-locale files will be generated with the default locale set to English. It also includes generation of `.content` files using the `extract` command, and the compiler. (See [Compiler](https://intlayer.org/doc/compiler) or [Extract](https://github.com/aymericzip/intlayer/edit/main/docs/docs/en/cli/extract.md) for more information.)
130
130
 
131
131
  ## Per-Locale Format
132
132
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2025-09-09
3
- updatedAt: 2026-02-25
3
+ updatedAt: 2026-03-10
4
4
  title: Intlayer Compiler | Extracción Automática de Contenido para i18n
5
5
  description: Automatiza tu proceso de internacionalización con el Intlayer Compiler. Extrae contenido directamente de tus componentes para una i18n más rápida y eficiente en Vite, Next.js y más.
6
6
  keywords:
@@ -20,6 +20,9 @@ slugs:
20
20
  - doc
21
21
  - compiler
22
22
  history:
23
+ - version: 8.2.0
24
+ date: 2026-03-10
25
+ changes: Update compiler options, add FilePathPattern support
23
26
  - version: 8.1.7
24
27
  date: 2026-02-25
25
28
  changes: Actualizar opciones del compilador
@@ -157,7 +160,6 @@ import { type IntlayerConfig, Locales } from "intlayer";
157
160
  const config: IntlayerConfig = {
158
161
  compiler: {
159
162
  /**
160
- * Indica si el compilador debe estar habilitado.
161
163
  * Establécelo en 'build-only' para omitir el compilador durante el desarrollo y acelerar los tiempos de inicio.
162
164
  */
163
165
  enabled: true,
@@ -171,23 +173,28 @@ const config: IntlayerConfig = {
171
173
  ],
172
174
 
173
175
  /**
174
- * Patrón para excluir de la optimización.
176
+ * Patrón a excluir de la optimización.
175
177
  */
176
178
  excludePattern: ["**/node_modules/**"],
177
179
 
178
180
  /**
179
181
  * Directorio de salida para los diccionarios optimizados.
180
182
  */
181
- outputDir: "i18n",
183
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
184
+
185
+ /**
186
+ * Inserta solo el contenido en el archivo generado, sin clave.
187
+ */
188
+ noMetadata: false,
182
189
 
183
190
  /**
184
191
  * Prefijo de clave de diccionario
185
192
  */
186
- dictionaryKeyPrefix: "", // Eliminar prefijo base
193
+ dictionaryKeyPrefix: "", // Eliminar el prefijo base
187
194
 
188
195
  /**
189
196
  * Indica si los componentes deben guardarse después de ser transformados.
190
- * De esta manera, el compilador puede ejecutarse solo una vez para transformar la aplicación y luego puede eliminarse.
197
+ * De esta manera, el compilador puede ejecutarse una sola vez para transformar la aplicación y luego puede eliminarse.
191
198
  */
192
199
  saveComponents: false,
193
200
  },
@@ -209,3 +216,61 @@ npx intlayer fill # Rellenar traducciones faltantes
209
216
  ```
210
217
 
211
218
  > Para más detalles, consulta la [documentación de la CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/cli/ci.md)
219
+
220
+ ### Referencia de configuración del compilador
221
+
222
+ Las siguientes propiedades pueden configurarse en el bloque `compiler` de tu archivo `intlayer.config.ts`:
223
+
224
+ - **enabled**:
225
+ - _Tipo_: `boolean | 'build-only'`
226
+ - _Por defecto_: `true`
227
+ - _Descripción_: Indica si el compilador debe estar habilitado.
228
+ - **dictionaryKeyPrefix**:
229
+ - _Tipo_: `string`
230
+ - _Por defecto_: `'comp-'`
231
+ - _Descripción_: Prefijo para las claves de diccionario extraídas.
232
+ - **transformPattern**:
233
+ - _Tipo_: `string | string[]`
234
+ - _Por defecto_: `['**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}', '!**/node_modules/**']`
235
+ - _Descripción_: Patrones para recorrer el código a optimizar.
236
+ - **excludePattern**:
237
+ - _Tipo_: `string | string[]`
238
+ - _Por defecto_: `['**/node_modules/**']`
239
+ - _Descripción_: Patrones para excluir de la optimización.
240
+ - **outputDir** (Deprecated):
241
+ - _Tipo_: `string`
242
+ - _Por defecto_: `'compiler'`
243
+ - _Descripción_: El directorio donde se almacenarán los diccionarios extraídos.
244
+
245
+ - **output**:
246
+ - _Type_: `FilePathPattern`
247
+ - _Por defecto_: `({ key }) => 'compiler/${key}.content.json'`
248
+ - _Descripción_: Define la ruta de los archivos de salida. Reemplaza `outputDir`. Maneja variables dinámicas como `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{componentFormat}}`. Se puede configurar como una cadena usando el formato `'my/{{var}}/path'` o como una función.
249
+ - _Nota_: `./**/*` Los caminos se resuelven de forma relativa al componente. `/**/*` los caminos se resuelven de forma relativa al `baseDir` de Intlayer.
250
+ - _Ejemplo_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
251
+
252
+ - **noMetadata**:
253
+ - _Tipo_: `boolean`
254
+ - _Por defecto_: `false`
255
+ - _Descripción_: Indica si los metadatos deben guardarse en el archivo. Si es verdadero, el compilador no guardará los metadatos de los diccionarios (clave, contenedor de contenido).
256
+ - _Nota_: Útil si se usa con el plugin `loadJSON`.
257
+ - _Ejemplo_: Si es `true`:
258
+ ```json
259
+ {
260
+ "key": "value"
261
+ }
262
+ ```
263
+ Si es `false`:
264
+ ```json
265
+ {
266
+ "key": "value",
267
+ "content": {
268
+ "key": "value"
269
+ }
270
+ }
271
+ ```
272
+
273
+ - **saveComponents**:
274
+ - _Tipo_: `boolean`
275
+ - _Por defecto_: `false`
276
+ - _Descripción_: Indica si los componentes deben guardarse después de ser transformados.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2024-08-13
3
- updatedAt: 2026-02-25
3
+ updatedAt: 2026-03-10
4
4
  title: Configuración
5
5
  description: Aprende cómo configurar Intlayer para tu aplicación. Entiende las diversas configuraciones y opciones disponibles para personalizar Intlayer según tus necesidades.
6
6
  keywords:
@@ -14,6 +14,9 @@ slugs:
14
14
  - concept
15
15
  - configuration
16
16
  history:
17
+ - version: 8.2.0
18
+ date: 2026-03-10
19
+ changes: Update compiler options, add 'output' and 'noMetadata' support
17
20
  - version: 8.1.7
18
21
  date: 2026-02-25
19
22
  changes: Actualizar opciones del compilador
@@ -419,12 +422,12 @@ const config: IntlayerConfig = {
419
422
  */
420
423
  compiler: {
421
424
  /**
422
- * Indicates if the compiler should be enabled.
425
+ * Establécelo en 'build-only' para omitir el compilador durante el desarrollo y acelerar los tiempos de inicio.
423
426
  */
424
427
  enabled: true,
425
428
 
426
429
  /**
427
- * Pattern to traverse the code to optimize.
430
+ * Patrón para recorrer el código a optimizar.
428
431
  */
429
432
  transformPattern: [
430
433
  "**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}",
@@ -432,23 +435,28 @@ const config: IntlayerConfig = {
432
435
  ],
433
436
 
434
437
  /**
435
- * Pattern to exclude from the optimization.
438
+ * Patrón a excluir de la optimización.
436
439
  */
437
440
  excludePattern: ["**/node_modules/**"],
438
441
 
439
442
  /**
440
- * Output directory for the optimized dictionaries.
443
+ * Directorio de salida para los diccionarios optimizados.
441
444
  */
442
- outputDir: "compiler",
445
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
443
446
 
444
447
  /**
445
- * Dictionary key prefix
448
+ * Inserta solo el contenido en el archivo generado, sin clave.
446
449
  */
447
- dictionaryKeyPrefix: "", // Remove base prefix
450
+ noMetadata: false,
448
451
 
449
452
  /**
450
- * Indicates if the components should be saved after being transformed.
451
- * That way, the compiler can be run only once to transform the app, and then it can be removed.
453
+ * Prefijo de clave de diccionario
454
+ */
455
+ dictionaryKeyPrefix: "", // Eliminar el prefijo base
456
+
457
+ /**
458
+ * Indica si los componentes deben guardarse después de ser transformados.
459
+ * De esta manera, el compilador puede ejecutarse una sola vez para transformar la aplicación y luego puede eliminarse.
452
460
  */
453
461
  saveComponents: false,
454
462
  },
@@ -704,7 +712,7 @@ Configuraciones relacionadas con el manejo de contenido dentro de la aplicación
704
712
  #### Propiedades
705
713
 
706
714
  - **autoFill**:
707
- - _Tipo_: `boolean | string | { [key in Locales]?: string }`
715
+ - _Tipo_: `boolean | string | FilePathPattern | { [key in Locales]?: string }`
708
716
  - _Por defecto_: `undefined`
709
717
  - _Descripción_: Indica cómo debe completarse automáticamente el contenido usando IA. Puede declararse globalmente en el archivo `intlayer.config.ts`.
710
718
  - _Ejemplo_: true
@@ -962,10 +970,10 @@ Las opciones de compilación se aplican a los plugins `@intlayer/babel` y `@intl
962
970
  - _Nota_: Puede usarse para deshabilitar la compilación de diccionarios, por ejemplo cuando se debe evitar la ejecución en un entorno Node.js.
963
971
 
964
972
  - **checkTypes**:
965
- - _Type_: `boolean`
966
- - _Default_: `false`
967
- - _Description_: Indica si la compilación debe comprobar los tipos de TypeScript y registrar errores.
968
- - _Note_: Esto puede ralentizar la compilación.
973
+ - _Tipo_: `boolean`
974
+ - _Por defecto_: `false`
975
+ - _Descripción_: Indica si la compilación debe comprobar los tipos de TypeScript y registrar errores.
976
+ - _Nota_: Esto puede ralentizar la compilación.
969
977
 
970
978
  - **optimize**:
971
979
  - _Tipo_: `boolean`
@@ -978,7 +986,7 @@ Las opciones de compilación se aplican a los plugins `@intlayer/babel` y `@intl
978
986
  - _Nota_: Asegúrese de que todas las claves estén declaradas estáticamente en las llamadas a `useIntlayer`. Por ejemplo, `useIntlayer('navbar')`.
979
987
 
980
988
  - **importMode**:
981
- - _Note_: **Deprecated**: Use `dictionary.importMode` instead.
989
+ - _Nota_: **Deprecated**: Use `dictionary.importMode` instead.
982
990
  - _Tipo_: `'static' | 'dynamic' | 'fetch'`
983
991
  - _Por defecto_: `'static'`
984
992
  - _Descripción_: Controla cómo se importan los diccionarios.
@@ -1057,3 +1065,31 @@ Ajustes que controlan el compilador Intlayer, que extrae diccionarios directamen
1057
1065
  - _Tipo_: `string`
1058
1066
  - _Por defecto_: `'compiler'`
1059
1067
  - _Descripción_: El directorio donde se almacenarán los diccionarios extraídos, relativo a la ruta base de su proyecto.
1068
+
1069
+ - **output**:
1070
+ - _Type_: `FilePathPattern`
1071
+ - _Por defecto_: `({ key }) => 'compiler/${key}.content.json'`
1072
+ - _Descripción_: Define la ruta de los archivos de salida. Reemplaza `outputDir`. Maneja variables dinámicas como `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{componentFormat}}`. Se puede configurar como una cadena usando el formato `'my/{{var}}/path'` o como una función.
1073
+ - _Nota_: `./**/*` Los caminos se resuelven de forma relativa al componente. `/**/*` los caminos se resuelven de forma relativa al `baseDir` de Intlayer.
1074
+ - _Ejemplo_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
1075
+
1076
+ - **noMetadata**:
1077
+ - _Tipo_: `boolean`
1078
+ - _Por defecto_: `false`
1079
+ - _Descripción_: Indica si los metadatos deben guardarse en el archivo. Si es verdadero, el compilador no guardará los metadatos de los diccionarios (clave, contenedor de contenido).
1080
+ - _Nota_: Útil si se usa con el plugin `loadJSON`.
1081
+ - _Ejemplo_: Si es `true`:
1082
+ ```json
1083
+ {
1084
+ "key": "value"
1085
+ }
1086
+ ```
1087
+ Si es `false`:
1088
+ ```json
1089
+ {
1090
+ "key": "value",
1091
+ "content": {
1092
+ "key": "value"
1093
+ }
1094
+ }
1095
+ ```
@@ -20,6 +20,9 @@ slugs:
20
20
  applicationTemplate: https://github.com/aymericzip/intlayer-next-no-lolale-path-template
21
21
  youtubeVideo: https://www.youtube.com/watch?v=e_PPG7PTqGU
22
22
  history:
23
+ - version: 8.2.0
24
+ date: 2026-03-09
25
+ changes: Update compiler options, add FilePathPattern support
23
26
  - version: 8.1.6
24
27
  date: 2026-02-23
25
28
  changes: Versión inicial
@@ -135,7 +138,12 @@ const config: IntlayerConfig = {
135
138
  /**
136
139
  * Directorio de salida para los diccionarios optimizados.
137
140
  */
138
- outputDir: "compiler",
141
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
142
+
143
+ /**
144
+ * Inserta solo el contenido en el archivo generado, sin clave.
145
+ */
146
+ noMetadata: false,
139
147
 
140
148
  /**
141
149
  * Prefijo de clave de diccionario
@@ -19,6 +19,9 @@ slugs:
19
19
  applicationTemplate: https://github.com/aymericzip/intlayer-vite-react-template
20
20
  youtubeVideo: https://www.youtube.com/watch?v=dS9L7uJeak4
21
21
  history:
22
+ - version: 8.2.0
23
+ date: 2026-03-09
24
+ changes: Update compiler options, add FilePathPattern support
22
25
  - version: 8.1.6
23
26
  date: 2026-02-23
24
27
  changes: Lanzamiento inicial
@@ -132,7 +135,12 @@ const config: IntlayerConfig = {
132
135
  /**
133
136
  * Directorio de salida para los diccionarios optimizados.
134
137
  */
135
- outputDir: "compiler",
138
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
139
+
140
+ /**
141
+ * Inserta solo el contenido en el archivo generado, sin clave.
142
+ */
143
+ noMetadata: false,
136
144
 
137
145
  /**
138
146
  * Prefijo de clave de diccionario