@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 | Ekstraksi Konten Otomatis untuk i18n
5
5
  description: Otomatiskan proses internasionalisasi Anda dengan Intlayer Compiler. Ekstrak konten langsung dari komponen Anda untuk i18n yang lebih cepat dan efisien di Vite, Next.js, dan lainnya.
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: Perbarui opsi kompiler
@@ -157,13 +160,12 @@ import { type IntlayerConfig, Locales } from "intlayer";
157
160
  const config: IntlayerConfig = {
158
161
  compiler: {
159
162
  /**
160
- * Menunjukkan apakah compiler harus diaktifkan.
161
- * Atur ke 'build-only' untuk melewatkan compiler selama pengembangan dan mempercepat waktu startup.
163
+ * Atur ke 'build-only' untuk melewatkan kompiler selama pengembangan dan mempercepat waktu mulai.
162
164
  */
163
165
  enabled: true,
164
166
 
165
167
  /**
166
- * Pola untuk menelusuri kode yang akan dioptimalkan.
168
+ * Pattern to traverse the code to optimize.
167
169
  */
168
170
  transformPattern: [
169
171
  "**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}",
@@ -171,23 +173,28 @@ const config: IntlayerConfig = {
171
173
  ],
172
174
 
173
175
  /**
174
- * Pola untuk dikecualikan dari pengoptimalan.
176
+ * Pattern to exclude from the optimization.
175
177
  */
176
178
  excludePattern: ["**/node_modules/**"],
177
179
 
178
180
  /**
179
181
  * Direktori output untuk kamus yang dioptimalkan.
180
182
  */
181
- outputDir: "i18n",
183
+ output: ({ key }) => `compiler/${key}.content.json`,
184
+
185
+ /**
186
+ * Masukkan konten saja dalam file yang dihasilkan, tanpa kunci.
187
+ */
188
+ noMetadata: false,
182
189
 
183
190
  /**
184
191
  * Awalan kunci kamus
185
192
  */
186
- dictionaryKeyPrefix: "", // Hapus awalan basis
193
+ dictionaryKeyPrefix: "", // Remove base prefix
187
194
 
188
195
  /**
189
196
  * Menunjukkan apakah komponen harus disimpan setelah ditransformasi.
190
- * Dengan begitu, compiler hanya dapat dijalankan sekali untuk mentransformasi aplikasi, dan kemudian dapat dihapus.
197
+ * Dengan begitu, kompiler hanya perlu dijalankan sekali untuk mentransformasi aplikasi, lalu dapat dihapus.
191
198
  */
192
199
  saveComponents: false,
193
200
  },
@@ -209,3 +216,61 @@ npx intlayer fill # Isi terjemahan yang hilang
209
216
  ```
210
217
 
211
218
  > Untuk rincian lebih lanjut, silakan merujuk ke [dokumentasi CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/cli/ci.md)
219
+
220
+ ### Referensi Konfigurasi Kompiler
221
+
222
+ Properti berikut dapat dikonfigurasi dalam blok `compiler` pada file `intlayer.config.ts` Anda:
223
+
224
+ - **enabled**:
225
+ - _Tipe_: `boolean | 'build-only'`
226
+ - _Default_: `true`
227
+ - _Deskripsi_: Menunjukkan apakah kompiler harus diaktifkan.
228
+ - **dictionaryKeyPrefix**:
229
+ - _Tipe_: `string`
230
+ - _Default_: `'comp-'`
231
+ - _Deskripsi_: Awalan untuk kunci kamus yang diekstrak.
232
+ - **transformPattern**:
233
+ - _Tipe_: `string | string[]`
234
+ - _Default_: `['**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}', '!**/node_modules/**']`
235
+ - _Deskripsi_: Pola untuk menelusuri kode yang ingin dioptimalkan.
236
+ - **excludePattern**:
237
+ - _Tipe_: `string | string[]`
238
+ - _Default_: `['**/node_modules/**']`
239
+ - _Deskripsi_: Pola yang harus dikecualikan dari optimasi.
240
+ - **outputDir** (Deprecated):
241
+ - _Tipe_: `string`
242
+ - _Default_: `'compiler'`
243
+ - _Deskripsi_: Direktori tempat kamus yang diekstrak akan disimpan.
244
+
245
+ - **output**:
246
+ - _Tipe_: `FilePathPattern`
247
+ - _Default_: `({ key }) => 'compiler/${key}.content.json'`
248
+ - _Deskripsi_: Mendefinisikan jalur file output. Menggantikan `outputDir`. Menangani variabel dinamis seperti `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, dan `{{componentFormat}}`. Dapat diatur sebagai string menggunakan format `'my/{{var}}/path'`, atau sebagai fungsi.
249
+ - _Catatan_: Jalur `./**/*` diselesaikan relatif terhadap komponen. Jalur `/**/*` diselesaikan relatif terhadap `baseDir` Intlayer.
250
+ - _Contoh_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
251
+
252
+ - **noMetadata**:
253
+ - _Tipe_: `boolean`
254
+ - _Default_: `false`
255
+ - _Deskripsi_: Menunjukkan apakah metadata harus disimpan dalam file. Jika benar, kompiler tidak akan menyimpan metadata kamus (kunci, pembungkus konten).
256
+ - _Catatan_: Berguna jika digunakan dengan plugin `loadJSON`.
257
+ - _Contoh_: Jika `true`:
258
+ ```json
259
+ {
260
+ "key": "value"
261
+ }
262
+ ```
263
+ Jika `false`:
264
+ ```json
265
+ {
266
+ "key": "value",
267
+ "content": {
268
+ "key": "value"
269
+ }
270
+ }
271
+ ```
272
+
273
+ - **saveComponents**:
274
+ - _Tipe_: `boolean`
275
+ - _Default_: `false`
276
+ - _Deskripsi_: Menunjukkan apakah komponen harus disimpan setelah ditransformasi.
@@ -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: Perbarui opsi kompiler
@@ -437,7 +440,7 @@ const config: IntlayerConfig = {
437
440
  */
438
441
  compiler: {
439
442
  /**
440
- * Indicates if the compiler should be enabled.
443
+ * Menunjukkan apakah kompiler harus diaktifkan.
441
444
  */
442
445
  enabled: true,
443
446
 
@@ -455,18 +458,23 @@ const config: IntlayerConfig = {
455
458
  excludePattern: ["**/node_modules/**"],
456
459
 
457
460
  /**
458
- * Output directory for the optimized dictionaries.
461
+ * Direktori output untuk kamus yang dioptimalkan.
459
462
  */
460
- outputDir: "compiler",
463
+ output: ({ key }) => `compiler/${key}.content.json`,
461
464
 
462
465
  /**
463
- * Dictionary key prefix
466
+ * Masukkan konten saja dalam file yang dihasilkan, tanpa kunci.
467
+ */
468
+ noMetadata: false,
469
+
470
+ /**
471
+ * Awalan kunci kamus
464
472
  */
465
473
  dictionaryKeyPrefix: "", // Remove base prefix
466
474
 
467
475
  /**
468
- * Indicates if the components should be saved after being transformed.
469
- * That way, the compiler can be run only once to transform the app, and then it can be removed.
476
+ * Menunjukkan apakah komponen harus disimpan setelah ditransformasi.
477
+ * Dengan begitu, kompiler hanya perlu dijalankan sekali untuk mentransformasi aplikasi, lalu dapat dihapus.
470
478
  */
471
479
  saveComponents: false,
472
480
  },
@@ -1082,7 +1090,7 @@ Opsi build berlaku untuk plugin `@intlayer/babel` dan `@intlayer/swc`.
1082
1090
  - _Catatan_: Pastikan semua kunci dideklarasikan secara statis dalam panggilan `useIntlayer`. Contoh: `useIntlayer('navbar')`.
1083
1091
 
1084
1092
  - **importMode**:
1085
- - _Note_: **Deprecated**: Use `dictionary.importMode` instead.
1093
+ - _Catatan_: **Deprecated**: Use `dictionary.importMode` instead.
1086
1094
  - _Tipe_: `'static' | 'dynamic' | 'fetch'`
1087
1095
  - _Default_: `'static'`
1088
1096
  - _Deskripsi_: Mengontrol bagaimana kamus diimpor.
@@ -1100,10 +1108,10 @@ Opsi build berlaku untuk plugin `@intlayer/babel` dan `@intlayer/swc`.
1100
1108
  - _Catatan_: Mode live akan menggunakan API sinkronisasi live untuk mengambil kamus. Jika panggilan API gagal, kamus akan diimpor secara dinamis sebagai mode "dynamic".
1101
1109
  - _Catatan_: Opsi ini tidak akan memengaruhi fungsi `getIntlayer`, `getDictionary`, `useDictionary`, `useDictionaryAsync` dan `useDictionaryDynamic`.
1102
1110
  - **checkTypes**:
1103
- - _Type_: `boolean`
1111
+ - _Tipe_: `boolean`
1104
1112
  - _Default_: `false`
1105
- - _Description_: Menunjukkan apakah build harus memeriksa tipe TypeScript dan mencatat kesalahan.
1106
- - _Note_: Hal ini dapat memperlambat proses build.
1113
+ - _Deskripsi_: Menunjukkan apakah build harus memeriksa tipe TypeScript dan mencatat kesalahan.
1114
+ - _Catatan_: Hal ini dapat memperlambat proses build.
1107
1115
 
1108
1116
  - **outputFormat**:
1109
1117
  - _Tipe_: `'esm' | 'cjs'`
@@ -1166,3 +1174,31 @@ Pengaturan yang mengontrol kompiler Intlayer, yang mengekstrak kamus langsung da
1166
1174
  - _Tipe_: `string`
1167
1175
  - _Default_: `'compiler'`
1168
1176
  - _Deskripsi_: Direktori tempat kamus yang diekstrak akan disimpan, relatif terhadap jalur dasar proyek Anda.
1177
+
1178
+ - **output**:
1179
+ - _Tipe_: `FilePathPattern`
1180
+ - _Default_: `({ key }) => 'compiler/${key}.content.json'`
1181
+ - _Deskripsi_: Mendefinisikan jalur file output. Menggantikan `outputDir`. Menangani variabel dinamis seperti `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, dan `{{componentFormat}}`. Dapat diatur sebagai string menggunakan format `'my/{{var}}/path'`, atau sebagai fungsi.
1182
+ - _Catatan_: Jalur `./**/*` diselesaikan relatif terhadap komponen. Jalur `/**/*` diselesaikan relatif terhadap `baseDir` Intlayer.
1183
+ - _Contoh_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
1184
+
1185
+ - **noMetadata**:
1186
+ - _Tipe_: `boolean`
1187
+ - _Default_: `false`
1188
+ - _Deskripsi_: Menunjukkan apakah metadata harus disimpan dalam file. Jika benar, kompiler tidak akan menyimpan metadata kamus (kunci, pembungkus konten).
1189
+ - _Catatan_: Berguna jika digunakan dengan plugin `loadJSON`.
1190
+ - _Contoh_: Jika `true`:
1191
+ ```json
1192
+ {
1193
+ "key": "value"
1194
+ }
1195
+ ```
1196
+ Jika `false`:
1197
+ ```json
1198
+ {
1199
+ "key": "value",
1200
+ "content": {
1201
+ "key": "value"
1202
+ }
1203
+ }
1204
+ ```
@@ -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: Rilis Awal
@@ -128,23 +131,28 @@ const config: IntlayerConfig = {
128
131
  },
129
132
  compiler: {
130
133
  /**
131
- * Menunjukkan apakah kompilator harus diaktifkan.
134
+ * Menunjukkan apakah kompiler harus diaktifkan.
132
135
  */
133
136
  enabled: true,
134
137
 
135
138
  /**
136
139
  * Direktori output untuk kamus yang dioptimalkan.
137
140
  */
138
- outputDir: "compiler",
141
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
142
+
143
+ /**
144
+ * Masukkan konten saja dalam file yang dihasilkan, tanpa kunci.
145
+ */
146
+ noMetadata: false,
139
147
 
140
148
  /**
141
149
  * Awalan kunci kamus
142
150
  */
143
- dictionaryKeyPrefix: "", // Hapus awalan dasar
151
+ dictionaryKeyPrefix: "", // Remove base prefix
144
152
 
145
153
  /**
146
- * Menunjukkan apakah komponen harus disimpan setelah diubah.
147
- * Dengan begitu, kompilator dapat dijalankan satu kali saja untuk mengubah aplikasi, kemudian dapat dihapus.
154
+ * Menunjukkan apakah komponen harus disimpan setelah ditransformasi.
155
+ * Dengan begitu, kompiler hanya perlu dijalankan sekali untuk mentransformasi aplikasi, lalu dapat dihapus.
148
156
  */
149
157
  saveComponents: false,
150
158
  },
@@ -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: Rilis awal
@@ -125,23 +128,28 @@ const config: IntlayerConfig = {
125
128
  },
126
129
  compiler: {
127
130
  /**
128
- * Menunjukkan apakah kompilator harus diaktifkan.
131
+ * Menunjukkan apakah kompiler harus diaktifkan.
129
132
  */
130
133
  enabled: true,
131
134
 
132
135
  /**
133
136
  * Direktori output untuk kamus yang dioptimalkan.
134
137
  */
135
- outputDir: "compiler",
138
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
139
+
140
+ /**
141
+ * Masukkan konten saja dalam file yang dihasilkan, tanpa kunci.
142
+ */
143
+ noMetadata: false,
136
144
 
137
145
  /**
138
146
  * Awalan kunci kamus
139
147
  */
140
- dictionaryKeyPrefix: "", // Hapus awalan dasar
148
+ dictionaryKeyPrefix: "", // Remove base prefix
141
149
 
142
150
  /**
143
- * Menunjukkan apakah komponen harus disimpan setelah diubah.
144
- * Dengan begitu, kompilator dapat dijalankan satu kali saja untuk mengubah aplikasi, kemudian dapat dihapus.
151
+ * Menunjukkan apakah komponen harus disimpan setelah ditransformasi.
152
+ * Dengan begitu, kompiler hanya perlu dijalankan sekali untuk mentransformasi aplikasi, lalu dapat dihapus.
145
153
  */
146
154
  saveComponents: false,
147
155
  },
@@ -128,7 +128,7 @@ const config: IntlayerConfig = {
128
128
  export default config;
129
129
  ```
130
130
 
131
- Dengan menggunakan konfigurasi ini, semua file per-locale akan dibuat dengan locale default yang diatur ke bahasa Inggris. Ini juga mencakup pembuatan file `.content` menggunakan perintah `extract`, dan compiler. (Lihat [Compiler](https://intlayer.org/doc/compiler) atau [Extract](https://intlayer.org/doc/concept/cli/extract) untuk informasi lebih lanjut.)
131
+ Dengan menggunakan konfigurasi ini, semua file per-locale akan dibuat dengan locale default yang diatur ke bahasa Inggris. Ini juga mencakup pembuatan file `.content` menggunakan perintah `extract`, dan compiler. (Lihat [Compiler](https://intlayer.org/doc/compiler) atau [Extract](https://github.com/aymericzip/intlayer/edit/main/docs/docs/en/cli/extract.md) untuk informasi lebih lanjut.)
132
132
 
133
133
  ## Format Per-Locale
134
134
 
@@ -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: Compiler Intlayer | Estrazione automatica dei contenuti per i18n
5
5
  description: Automatizza il tuo processo di internazionalizzazione con il compilatore Intlayer. Estrai contenuti direttamente dai tuoi componenti per un i18n più veloce ed efficiente in Vite, Next.js e altro.
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: Aggiorna le opzioni del compilatore
@@ -157,13 +160,12 @@ import { type IntlayerConfig, Locales } from "intlayer";
157
160
  const config: IntlayerConfig = {
158
161
  compiler: {
159
162
  /**
160
- * Indica se il compiler deve essere abilitato.
161
- * Imposta su 'build-only' per saltare il compiler durante lo sviluppo e velocizzare i tempi di avvio.
163
+ * Imposta su 'build-only' per saltare il compilatore durante lo sviluppo e accelerare i tempi di avvio.
162
164
  */
163
165
  enabled: true,
164
166
 
165
167
  /**
166
- * Pattern per attraversare il codice da ottimizzare.
168
+ * Pattern to traverse the code to optimize.
167
169
  */
168
170
  transformPattern: [
169
171
  "**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}",
@@ -171,23 +173,28 @@ const config: IntlayerConfig = {
171
173
  ],
172
174
 
173
175
  /**
174
- * Pattern da escludere dall'ottimizzazione.
176
+ * Pattern to exclude from the optimization.
175
177
  */
176
178
  excludePattern: ["**/node_modules/**"],
177
179
 
178
180
  /**
179
181
  * Directory di output per i dizionari ottimizzati.
180
182
  */
181
- outputDir: "i18n",
183
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
184
+
185
+ /**
186
+ * Inserisci solo il contenuto nel file generato, senza chiave.
187
+ */
188
+ noMetadata: false,
182
189
 
183
190
  /**
184
191
  * Prefisso chiave dizionario
185
192
  */
186
- dictionaryKeyPrefix: "", // Rimuovi prefisso di base
193
+ dictionaryKeyPrefix: "", // Remove base prefix
187
194
 
188
195
  /**
189
196
  * Indica se i componenti devono essere salvati dopo essere stati trasformati.
190
- * In questo modo, il compiler può essere eseguito solo una volta per trasformare l'app, e poi può essere rimosso.
197
+ * In questo modo, il compilatore può essere eseguito una sola volta per trasformare l'app e poi rimosso.
191
198
  */
192
199
  saveComponents: false,
193
200
  },
@@ -209,3 +216,61 @@ npx intlayer fill # Riempi le traduzioni mancanti
209
216
  ```
210
217
 
211
218
  > Per maggiori dettagli, fare riferimento alla [documentazione CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/cli/ci.md)
219
+
220
+ ### Riferimento alla configurazione del compilatore
221
+
222
+ Le seguenti proprietà possono essere configurate nel blocco `compiler` del file `intlayer.config.ts`:
223
+
224
+ - **enabled**:
225
+ - _Tipo_: `boolean | 'build-only'`
226
+ - _Predefinito_: `true`
227
+ - _Descrizione_: Indica se il compilatore deve essere abilitato.
228
+ - **dictionaryKeyPrefix**:
229
+ - _Tipo_: `string`
230
+ - _Predefinito_: `'comp-'`
231
+ - _Descrizione_: Prefisso per le chiavi del dizionario estratte.
232
+ - **transformPattern**:
233
+ - _Tipo_: `string | string[]`
234
+ - _Predefinito_: `['**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}', '!**/node_modules/**']`
235
+ - _Descrizione_: Modelli per attraversare il codice da ottimizzare.
236
+ - **excludePattern**:
237
+ - _Tipo_: `string | string[]`
238
+ - _Predefinito_: `['**/node_modules/**']`
239
+ - _Descrizione_: Modelli da escludere dall'ottimizzazione.
240
+ - **outputDir** (Deprecated):
241
+ - _Tipo_: `string`
242
+ - _Predefinito_: `'compiler'`
243
+ - _Descrizione_: La directory in cui verranno memorizzati i dizionari estratti.
244
+
245
+ - **output**:
246
+ - _Type_: `FilePathPattern`
247
+ - _Default_: `({ key }) => 'compiler/${key}.content.json'`
248
+ - _Descrizione_: Definisce il percorso dei file di output. Sostituisce `outputDir`. Gestisce variabili dinamiche come `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{componentFormat}}`. Può essere impostato come stringa utilizzando il formato `'my/{{var}}/path'` o come funzione.
249
+ - _Nota_: `./**/*` I percorsi sono risolti relativamente al componente. `/**/*` i percorsi sono risolti relativamente al `baseDir` di Intlayer.
250
+ - _Esempio_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
251
+
252
+ - **noMetadata**:
253
+ - _Tipo_: `boolean`
254
+ - _Predefinito_: `false`
255
+ - _Descrizione_: Indica se i metadati devono essere salvati nel file. Se vero, il compilatore non salverà i metadatati dei dizionari (chiave, contenitore del contenuto).
256
+ - _Nota_: Utile se utilizzato con il plugin `loadJSON`.
257
+ - _Esempio_: Se `true`:
258
+ ```json
259
+ {
260
+ "key": "value"
261
+ }
262
+ ```
263
+ Se `false`:
264
+ ```json
265
+ {
266
+ "key": "value",
267
+ "content": {
268
+ "key": "value"
269
+ }
270
+ }
271
+ ```
272
+
273
+ - **saveComponents**:
274
+ - _Tipo_: `boolean`
275
+ - _Predefinito_: `false`
276
+ - _Descrizione_: Indica se i componenti devono essere salvati dopo essere stati trasformati.
@@ -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: Configurazione
5
5
  description: Scopri come configurare Intlayer per la tua applicazione. Comprendi le varie impostazioni e opzioni disponibili per personalizzare Intlayer secondo le tue esigenze.
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: Aggiorna le opzioni del compilatore
@@ -419,7 +422,7 @@ const config: IntlayerConfig = {
419
422
  */
420
423
  compiler: {
421
424
  /**
422
- * Indicates if the compiler should be enabled.
425
+ * Indica se il compilatore deve essere abilitato.
423
426
  */
424
427
  enabled: true,
425
428
 
@@ -437,18 +440,23 @@ const config: IntlayerConfig = {
437
440
  excludePattern: ["**/node_modules/**"],
438
441
 
439
442
  /**
440
- * Output directory for the optimized dictionaries.
443
+ * Directory di output per i dizionari ottimizzati.
441
444
  */
442
- outputDir: "compiler",
445
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
443
446
 
444
447
  /**
445
- * Dictionary key prefix
448
+ * Inserisci solo il contenuto nel file generato, senza chiave.
449
+ */
450
+ noMetadata: false,
451
+
452
+ /**
453
+ * Prefisso chiave dizionario
446
454
  */
447
455
  dictionaryKeyPrefix: "", // Remove base prefix
448
456
 
449
457
  /**
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.
458
+ * Indica se i componenti devono essere salvati dopo essere stati trasformati.
459
+ * In questo modo, il compilatore può essere eseguito una sola volta per trasformare l'app e poi rimosso.
452
460
  */
453
461
  saveComponents: false,
454
462
  },
@@ -704,7 +712,7 @@ Impostazioni relative alla gestione del contenuto all'interno dell'applicazione,
704
712
  #### Proprietà
705
713
 
706
714
  - **autoFill**:
707
- - _Tipo_: `boolean | string | { [key in Locales]?: string }`
715
+ - _Tipo_: `boolean | string | FilePathPattern | { [key in Locales]?: string }`
708
716
  - _Predefinito_: `undefined`
709
717
  - _Descrizione_: Indica come il contenuto dovrebbe essere compilato automaticamente usando l'IA. Può essere dichiarato globalmente nel file `intlayer.config.ts`.
710
718
  - _Esempio_: true
@@ -832,11 +840,11 @@ Per ulteriori informazioni sui file di dichiarazione del contenuto e su come ven
832
840
  - **locale**
833
841
  - **location**
834
842
  - **importMode**:
835
- - _Note_: **Deprecated**: Use `dictionary.importMode` instead.
836
- - _Type_: `'static' | 'dynamic' | 'fetch'`
837
- - _Default_: `'static'`
838
- - _Description_: Controls how dictionaries are imported.
839
- - _Example_: `'dynamic'`
843
+ - _Nota_: **Deprecated**: Use `dictionary.importMode` instead.
844
+ - _Tipo_: `'static' | 'dynamic' | 'fetch'`
845
+ - _Predefinito_: `'static'`
846
+ - _Descrizione_: Controls how dictionaries are imported.
847
+ - _Esempio_: `'dynamic'`
840
848
  - **priority**
841
849
  - **live**
842
850
  - **schema**
@@ -968,10 +976,10 @@ Le opzioni di build si applicano ai plugin `@intlayer/babel` e `@intlayer/swc`.
968
976
  - _Nota_: Può essere utilizzato per disabilitare la build dei dizionari, ad esempio quando l'esecuzione in un ambiente Node.js dovrebbe essere evitata.
969
977
 
970
978
  - **checkTypes**:
971
- - _Type_: `boolean`
972
- - _Default_: `false`
973
- - _Description_: Indica se la build deve controllare i tipi TypeScript e registrare gli errori.
974
- - _Note_: Questo può rallentare la build.
979
+ - _Tipo_: `boolean`
980
+ - _Predefinito_: `false`
981
+ - _Descrizione_: Indica se la build deve controllare i tipi TypeScript e registrare gli errori.
982
+ - _Nota_: Questo può rallentare la build.
975
983
 
976
984
  - **optimize**:
977
985
  - _Tipo_: `boolean`
@@ -984,7 +992,7 @@ Le opzioni di build si applicano ai plugin `@intlayer/babel` e `@intlayer/swc`.
984
992
  - _Nota_: Assicurarsi che tutte le chiavi siano dichiarate staticamente nelle chiamate a `useIntlayer`. Es. `useIntlayer('navbar')`.
985
993
 
986
994
  - **importMode**:
987
- - _Note_: **Deprecated**: Use `dictionary.importMode` instead.
995
+ - _Nota_: **Deprecated**: Use `dictionary.importMode` instead.
988
996
  - _Tipo_: `'static' | 'dynamic' | 'fetch'`
989
997
  - _Predefinito_: `'static'`
990
998
  - _Descrizione_: Controlla come vengono importati i dizionari.
@@ -1063,3 +1071,31 @@ Impostazioni che controllano il compilatore Intlayer, che estrae i dizionari dir
1063
1071
  - _Tipo_: `string`
1064
1072
  - _Predefinito_: `'compiler'`
1065
1073
  - _Descrizione_: La directory in cui verranno memorizzati i dizionari estratti, relativa al percorso di base del progetto.
1074
+
1075
+ - **output**:
1076
+ - _Type_: `FilePathPattern`
1077
+ - _Default_: `({ key }) => 'compiler/${key}.content.json'`
1078
+ - _Descrizione_: Definisce il percorso dei file di output. Sostituisce `outputDir`. Gestisce variabili dinamiche come `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{componentFormat}}`. Può essere impostato come stringa utilizzando il formato `'my/{{var}}/path'` o come funzione.
1079
+ - _Nota_: `./**/*` I percorsi sono risolti relativamente al componente. `/**/*` i percorsi sono risolti relativamente al `baseDir` di Intlayer.
1080
+ - _Esempio_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
1081
+
1082
+ - **noMetadata**:
1083
+ - _Tipo_: `boolean`
1084
+ - _Predefinito_: `false`
1085
+ - _Descrizione_: Indica se i metadati devono essere salvati nel file. Se vero, il compilatore non salverà i metadatati dei dizionari (chiave, contenitore del contenuto).
1086
+ - _Nota_: Utile se utilizzato con il plugin `loadJSON`.
1087
+ - _Esempio_: Se `true`:
1088
+ ```json
1089
+ {
1090
+ "key": "value"
1091
+ }
1092
+ ```
1093
+ Se `false`:
1094
+ ```json
1095
+ {
1096
+ "key": "value",
1097
+ "content": {
1098
+ "key": "value"
1099
+ }
1100
+ }
1101
+ ```
@@ -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: Rilascio iniziale
@@ -135,16 +138,21 @@ const config: IntlayerConfig = {
135
138
  /**
136
139
  * Directory di output per i dizionari ottimizzati.
137
140
  */
138
- outputDir: "compiler",
141
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
139
142
 
140
143
  /**
141
- * Prefisso della chiave del dizionario
144
+ * Inserisci solo il contenuto nel file generato, senza chiave.
142
145
  */
143
- dictionaryKeyPrefix: "", // Rimuovi il prefisso di base
146
+ noMetadata: false,
147
+
148
+ /**
149
+ * Prefisso chiave dizionario
150
+ */
151
+ dictionaryKeyPrefix: "", // Remove base prefix
144
152
 
145
153
  /**
146
154
  * Indica se i componenti devono essere salvati dopo essere stati trasformati.
147
- * In questo modo, il compilatore può essere eseguito una sola volta per trasformare l'app e può quindi essere rimosso.
155
+ * In questo modo, il compilatore può essere eseguito una sola volta per trasformare l'app e poi rimosso.
148
156
  */
149
157
  saveComponents: false,
150
158
  },
@@ -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: Rilascio iniziale
@@ -137,16 +140,21 @@ const config: IntlayerConfig = {
137
140
  /**
138
141
  * Directory di output per i dizionari ottimizzati.
139
142
  */
140
- outputDir: "compiler",
143
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
141
144
 
142
145
  /**
143
- * Prefisso della chiave del dizionario
146
+ * Inserisci solo il contenuto nel file generato, senza chiave.
144
147
  */
145
- dictionaryKeyPrefix: "", // Rimuovi il prefisso di base
148
+ noMetadata: false,
149
+
150
+ /**
151
+ * Prefisso chiave dizionario
152
+ */
153
+ dictionaryKeyPrefix: "", // Remove base prefix
146
154
 
147
155
  /**
148
156
  * Indica se i componenti devono essere salvati dopo essere stati trasformati.
149
- * In questo modo, il compilatore può essere eseguito una sola volta per trasformare l'app e può quindi essere rimosso.
157
+ * In questo modo, il compilatore può essere eseguito una sola volta per trasformare l'app e poi rimosso.
150
158
  */
151
159
  saveComponents: false,
152
160
  },