You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add an opt-in `emitTsDeclarations` compiler flag to generate fresh `.d.ts` files (incl. `m` re-export and locale fallbacks) for locale-modules so IDEs stop reporting stale/missing message keys.
Copy file name to clipboardExpand all lines: inlang/packages/paraglide/paraglide-js/docs-api/compiler-options.md
+51-19Lines changed: 51 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,15 @@
2
2
3
3
> **CompilerOptions** = `object`
4
4
5
-
Defined in: [compiler-options.ts:19](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
5
+
Defined in: [compiler-options.ts:20](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
Defined in: [compiler-options.ts:154](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
13
+
Defined in: [compiler-options.ts:155](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
14
14
15
15
The `additionalFiles` option is an array of paths to additional files that should be copied to the output directory.
16
16
@@ -40,7 +40,7 @@ The output will look like this:
40
40
41
41
> `optional`**cleanOutdir**: `boolean`
42
42
43
-
Defined in: [compiler-options.ts:260](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
43
+
Defined in: [compiler-options.ts:280](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
44
44
45
45
Whether to clean the output directory before writing the new files.
46
46
@@ -54,7 +54,7 @@ true
54
54
55
55
> `optional`**cookieDomain**: `string`
56
56
57
-
Defined in: [compiler-options.ts:128](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
57
+
Defined in: [compiler-options.ts:129](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
58
58
59
59
The host to which the cookie will be sent.
60
60
If undefined or empty, the domain attribute is omitted from the cookie, scoping it to the exact current domain only (no subdomains).
Defined in: [compiler-options.ts:108](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
86
+
Defined in: [compiler-options.ts:109](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
87
87
88
88
The max-age in seconds of the cookie until it expires.
89
89
@@ -97,7 +97,7 @@ The max-age in seconds of the cookie until it expires.
97
97
98
98
> `optional`**cookieName**: `string`
99
99
100
-
Defined in: [compiler-options.ts:102](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
100
+
Defined in: [compiler-options.ts:103](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
101
101
102
102
The name of the cookie to use for the cookie strategy.
103
103
@@ -111,7 +111,7 @@ The name of the cookie to use for the cookie strategy.
Defined in: [compiler-options.ts:189](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
114
+
Defined in: [compiler-options.ts:209](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
115
115
116
116
Replaces AsyncLocalStorage with a synchronous implementation.
117
117
@@ -126,7 +126,7 @@ leak into another concurrent request.
126
126
127
127
> `optional`**emitGitIgnore**: `boolean`
128
128
129
-
Defined in: [compiler-options.ts:203](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
129
+
Defined in: [compiler-options.ts:223](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
130
130
131
131
If `emitGitIgnore` is set to `true` a `.gitignore` file will be emitted in the output directory. Defaults to `true`.
132
132
@@ -148,7 +148,7 @@ true
148
148
149
149
> `optional`**emitPrettierIgnore**: `boolean`
150
150
151
-
Defined in: [compiler-options.ts:168](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
151
+
Defined in: [compiler-options.ts:169](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
152
152
153
153
If `emitPrettierIgnore` is set to `true` a `.prettierignore` file will be emitted in the output directory. Defaults to `true`.
154
154
@@ -166,11 +166,39 @@ If `emitPrettierIgnore` is set to `true` a `.prettierignore` file will be emitte
166
166
true
167
167
```
168
168
169
+
#### emitTsDeclarations?
170
+
171
+
> `optional`**emitTsDeclarations**: `boolean`
172
+
173
+
Defined in: [compiler-options.ts:188](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
174
+
175
+
Emit `.d.ts` files for the generated output using the TypeScript compiler.
176
+
177
+
Enable this to give IDEs fresh, explicit typings for generated message modules
178
+
(useful when using `locale-modules` during development). Requires `typescript`
Defined in: [compiler-options.ts:77](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
201
+
Defined in: [compiler-options.ts:78](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
174
202
175
203
Whether or not to use experimental middleware locale splitting.
176
204
@@ -194,7 +222,7 @@ false
194
222
195
223
> `optional`**fs**: `any`
196
224
197
-
Defined in: [compiler-options.ts:267](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
225
+
Defined in: [compiler-options.ts:287](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
198
226
199
227
The file system to use. Defaults to `await import('node:fs')`.
200
228
@@ -204,7 +232,7 @@ Useful for testing the paraglide compiler by mocking the fs.
Defined in: [compiler-options.ts:178](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
235
+
Defined in: [compiler-options.ts:198](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
208
236
209
237
Whether to include an eslint-disable comment at the top of each .js file.
210
238
@@ -218,7 +246,7 @@ true
218
246
219
247
> `optional`**isServer**: `string`
220
248
221
-
Defined in: [compiler-options.ts:96](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
249
+
Defined in: [compiler-options.ts:97](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
222
250
223
251
Tree-shaking flag if the code is running on the server.
224
252
@@ -242,7 +270,7 @@ typeof window === "undefined"
242
270
243
271
> `optional`**localStorageKey**: `string`
244
272
245
-
Defined in: [compiler-options.ts:83](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
273
+
Defined in: [compiler-options.ts:84](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
246
274
247
275
The name of the localStorage key to use for the localStorage strategy.
248
276
@@ -256,7 +284,7 @@ The name of the localStorage key to use for the localStorage strategy.
256
284
257
285
> **outdir**: `string`
258
286
259
-
Defined in: [compiler-options.ts:43](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
287
+
Defined in: [compiler-options.ts:44](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
Defined in: [compiler-options.ts:254](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
304
+
Defined in: [compiler-options.ts:274](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
277
305
278
306
The `outputStructure` defines how modules are structured in the output.
279
307
@@ -332,7 +360,7 @@ The benefit are substantially fewer files which is needed in large projects.
332
360
333
361
> **project**: `string`
334
362
335
-
Defined in: [compiler-options.ts:31](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
363
+
Defined in: [compiler-options.ts:32](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
Defined in: [compiler-options.ts:61](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
380
+
Defined in: [compiler-options.ts:62](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
353
381
354
382
The strategy to use for getting the locale.
355
383
@@ -375,7 +403,7 @@ Custom strategies with the pattern `custom-[A-Za-z0-9]+` are supported.
Defined in: [compiler-options.ts:172](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
406
+
Defined in: [compiler-options.ts:192](https://github.com/opral/monorepo/tree/main/inlang/packages/paraglide/paraglide-js/src/compiler/compiler-options.ts)
0 commit comments