@analogjs/vite-plugin-angular 3.0.0-beta.3 → 3.0.0-beta.31

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 (76) hide show
  1. package/ngp/LICENSE +21 -0
  2. package/ngp/api.mjs +46048 -0
  3. package/ngp/build.json +4 -0
  4. package/ngp/ng_analyze.cjs +504 -0
  5. package/ngp/ng_analyze_bg.wasm +0 -0
  6. package/package.json +1 -1
  7. package/src/lib/angular-build-optimizer-plugin.js +6 -3
  8. package/src/lib/angular-build-optimizer-plugin.js.map +1 -1
  9. package/src/lib/angular-vite-plugin.d.ts +20 -5
  10. package/src/lib/angular-vite-plugin.js +30 -14
  11. package/src/lib/angular-vite-plugin.js.map +1 -1
  12. package/src/lib/compilation-api/compilation-api-plugin.js +3 -0
  13. package/src/lib/compilation-api/compilation-api-plugin.js.map +1 -1
  14. package/src/lib/compiler/compile.d.ts +1 -1
  15. package/src/lib/compiler/compile.js +158 -143
  16. package/src/lib/compiler/compile.js.map +1 -1
  17. package/src/lib/compiler/defer.d.ts +2 -3
  18. package/src/lib/compiler/defer.js +11 -13
  19. package/src/lib/compiler/defer.js.map +1 -1
  20. package/src/lib/compiler/dts-reader.d.ts +6 -1
  21. package/src/lib/compiler/dts-reader.js +15 -9
  22. package/src/lib/compiler/dts-reader.js.map +1 -1
  23. package/src/lib/compiler/hmr.d.ts +4 -0
  24. package/src/lib/compiler/hmr.js +7 -2
  25. package/src/lib/compiler/hmr.js.map +1 -1
  26. package/src/lib/compiler/index.d.ts +2 -2
  27. package/src/lib/compiler/index.js +4 -4
  28. package/src/lib/compiler/jit-metadata.d.ts +3 -1
  29. package/src/lib/compiler/jit-metadata.js +10 -8
  30. package/src/lib/compiler/jit-metadata.js.map +1 -1
  31. package/src/lib/compiler/jit-transform.js +2 -2
  32. package/src/lib/compiler/jit-transform.js.map +1 -1
  33. package/src/lib/compiler/js-emitter.d.ts +0 -3
  34. package/src/lib/compiler/js-emitter.js +3 -21
  35. package/src/lib/compiler/js-emitter.js.map +1 -1
  36. package/src/lib/compiler/registry.d.ts +7 -1
  37. package/src/lib/compiler/registry.js +23 -3
  38. package/src/lib/compiler/registry.js.map +1 -1
  39. package/src/lib/compiler/resource-inliner.d.ts +8 -9
  40. package/src/lib/compiler/resource-inliner.js +10 -18
  41. package/src/lib/compiler/resource-inliner.js.map +1 -1
  42. package/src/lib/compiler/style-ast.d.ts +9 -1
  43. package/src/lib/compiler/style-ast.js +26 -5
  44. package/src/lib/compiler/style-ast.js.map +1 -1
  45. package/src/lib/compiler/type-elision.d.ts +4 -3
  46. package/src/lib/compiler/type-elision.js +10 -11
  47. package/src/lib/compiler/type-elision.js.map +1 -1
  48. package/src/lib/compiler/utils.d.ts +14 -7
  49. package/src/lib/compiler/utils.js +38 -9
  50. package/src/lib/compiler/utils.js.map +1 -1
  51. package/src/lib/fast-compile-plugin.d.ts +3 -0
  52. package/src/lib/fast-compile-plugin.js +124 -38
  53. package/src/lib/fast-compile-plugin.js.map +1 -1
  54. package/src/lib/host.d.ts +2 -0
  55. package/src/lib/host.js +2 -0
  56. package/src/lib/host.js.map +1 -1
  57. package/src/lib/live-reload-plugin.d.ts +4 -3
  58. package/src/lib/live-reload-plugin.js +4 -3
  59. package/src/lib/live-reload-plugin.js.map +1 -1
  60. package/src/lib/ngp-compile-plugin.d.ts +3 -0
  61. package/src/lib/ngp-compile-plugin.js +344 -0
  62. package/src/lib/ngp-compile-plugin.js.map +1 -0
  63. package/src/lib/tools/src/builders/vite/vite-build.impl.js +2 -1
  64. package/src/lib/tools/src/builders/vite/vite-build.impl.js.map +1 -1
  65. package/src/lib/utils/hmr-component-updates.d.ts +7 -0
  66. package/src/lib/utils/hmr-component-updates.js +87 -0
  67. package/src/lib/utils/hmr-component-updates.js.map +1 -0
  68. package/src/lib/utils/lsp-type-checker.d.ts +55 -0
  69. package/src/lib/utils/lsp-type-checker.js +502 -0
  70. package/src/lib/utils/lsp-type-checker.js.map +1 -0
  71. package/src/lib/utils/plugin-config.d.ts +9 -0
  72. package/src/lib/utils/plugin-config.js +10 -1
  73. package/src/lib/utils/plugin-config.js.map +1 -1
  74. package/src/lib/utils/stylesheet-warning.d.ts +2 -0
  75. package/src/lib/utils/stylesheet-warning.js +8 -0
  76. package/src/lib/utils/stylesheet-warning.js.map +1 -0
package/ngp/build.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "revision": "457071571225970890bd5a6baee21373d3960c37",
3
+ "wasmBindgen": "0.2.121"
4
+ }
@@ -0,0 +1,504 @@
1
+ class WasmAnalyzer {
2
+ __destroy_into_raw() {
3
+ const ptr = this.__wbg_ptr;
4
+ this.__wbg_ptr = 0;
5
+ WasmAnalyzerFinalization.unregister(this);
6
+ return ptr;
7
+ }
8
+ free() {
9
+ const ptr = this.__destroy_into_raw();
10
+ wasm.__wbg_wasmanalyzer_free(ptr, 0);
11
+ }
12
+ /**
13
+ * @returns {number}
14
+ */
15
+ analyze() {
16
+ const ret = wasm.wasmanalyzer_analyze(this.__wbg_ptr);
17
+ if (ret[2]) {
18
+ throw takeFromExternrefTable0(ret[1]);
19
+ }
20
+ return ret[0] >>> 0;
21
+ }
22
+ /**
23
+ * @returns {number}
24
+ */
25
+ analyze_delta() {
26
+ const ret = wasm.wasmanalyzer_analyze_delta(this.__wbg_ptr);
27
+ if (ret[2]) {
28
+ throw takeFromExternrefTable0(ret[1]);
29
+ }
30
+ return ret[0] >>> 0;
31
+ }
32
+ /**
33
+ * @returns {number}
34
+ */
35
+ analyze_optimized() {
36
+ const ret = wasm.wasmanalyzer_analyze_optimized(this.__wbg_ptr);
37
+ if (ret[2]) {
38
+ throw takeFromExternrefTable0(ret[1]);
39
+ }
40
+ return ret[0] >>> 0;
41
+ }
42
+ /**
43
+ * @returns {number}
44
+ */
45
+ analyze_optimized_delta() {
46
+ const ret = wasm.wasmanalyzer_analyze_optimized_delta(this.__wbg_ptr);
47
+ if (ret[2]) {
48
+ throw takeFromExternrefTable0(ret[1]);
49
+ }
50
+ return ret[0] >>> 0;
51
+ }
52
+ /**
53
+ * Releases the stream `id` when its consumer stops reading before it ends.
54
+ *
55
+ * Dropping the receiver closes the channel. The engine's sends to a closed channel
56
+ * are ignored, so the analysis is no longer observed but is not cancelled. The NAPI
57
+ * `AnalysisIterator` behaves the same way when it is dropped. Closing a stream that
58
+ * already ended, or an unknown id, does nothing.
59
+ * @param {number} id
60
+ */
61
+ close_stream(id) {
62
+ wasm.wasmanalyzer_close_stream(this.__wbg_ptr, id);
63
+ }
64
+ /**
65
+ * @param {string} file_path
66
+ * @returns {string}
67
+ */
68
+ get_file_content(file_path) {
69
+ let deferred3_0;
70
+ let deferred3_1;
71
+ try {
72
+ const ptr0 = passStringToWasm0(file_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
73
+ const len0 = WASM_VECTOR_LEN;
74
+ const ret = wasm.wasmanalyzer_get_file_content(this.__wbg_ptr, ptr0, len0);
75
+ var ptr2 = ret[0];
76
+ var len2 = ret[1];
77
+ if (ret[3]) {
78
+ ptr2 = 0; len2 = 0;
79
+ throw takeFromExternrefTable0(ret[2]);
80
+ }
81
+ deferred3_0 = ptr2;
82
+ deferred3_1 = len2;
83
+ return getStringFromWasm0(ptr2, len2);
84
+ } finally {
85
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
86
+ }
87
+ }
88
+ /**
89
+ * @param {string} file_path
90
+ * @returns {string | undefined}
91
+ */
92
+ get_metadata_for_file(file_path) {
93
+ const ptr0 = passStringToWasm0(file_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
94
+ const len0 = WASM_VECTOR_LEN;
95
+ const ret = wasm.wasmanalyzer_get_metadata_for_file(this.__wbg_ptr, ptr0, len0);
96
+ let v2;
97
+ if (ret[0] !== 0) {
98
+ v2 = getStringFromWasm0(ret[0], ret[1]).slice();
99
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
100
+ }
101
+ return v2;
102
+ }
103
+ /**
104
+ * @param {string} template_path
105
+ * @returns {string | undefined}
106
+ */
107
+ get_ts_file_for_template(template_path) {
108
+ const ptr0 = passStringToWasm0(template_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
109
+ const len0 = WASM_VECTOR_LEN;
110
+ const ret = wasm.wasmanalyzer_get_ts_file_for_template(this.__wbg_ptr, ptr0, len0);
111
+ let v2;
112
+ if (ret[0] !== 0) {
113
+ v2 = getStringFromWasm0(ret[0], ret[1]).slice();
114
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
115
+ }
116
+ return v2;
117
+ }
118
+ /**
119
+ * @param {string} updates_json
120
+ * @returns {string}
121
+ */
122
+ invalidate_files(updates_json) {
123
+ let deferred3_0;
124
+ let deferred3_1;
125
+ try {
126
+ const ptr0 = passStringToWasm0(updates_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
127
+ const len0 = WASM_VECTOR_LEN;
128
+ const ret = wasm.wasmanalyzer_invalidate_files(this.__wbg_ptr, ptr0, len0);
129
+ var ptr2 = ret[0];
130
+ var len2 = ret[1];
131
+ if (ret[3]) {
132
+ ptr2 = 0; len2 = 0;
133
+ throw takeFromExternrefTable0(ret[2]);
134
+ }
135
+ deferred3_0 = ptr2;
136
+ deferred3_1 = len2;
137
+ return getStringFromWasm0(ptr2, len2);
138
+ } finally {
139
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
140
+ }
141
+ }
142
+ /**
143
+ * Constructs an analyzer with an optional JavaScript filesystem bridge (`WasmHostFs`).
144
+ * Without `host_fs`, only `virtualFiles` are visible.
145
+ * @param {string} options_json
146
+ * @param {any | null} [host_fs]
147
+ */
148
+ constructor(options_json, host_fs) {
149
+ const ptr0 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
150
+ const len0 = WASM_VECTOR_LEN;
151
+ const ret = wasm.wasmanalyzer_new(ptr0, len0, isLikeNone(host_fs) ? 0 : addToExternrefTable0(host_fs));
152
+ if (ret[2]) {
153
+ throw takeFromExternrefTable0(ret[1]);
154
+ }
155
+ this.__wbg_ptr = ret[0];
156
+ WasmAnalyzerFinalization.register(this, this.__wbg_ptr, this);
157
+ return this;
158
+ }
159
+ /**
160
+ * @returns {string | undefined}
161
+ */
162
+ pump() {
163
+ const ret = wasm.wasmanalyzer_pump(this.__wbg_ptr);
164
+ let v1;
165
+ if (ret[0] !== 0) {
166
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
167
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
168
+ }
169
+ return v1;
170
+ }
171
+ /**
172
+ * @param {string} containing_file
173
+ * @param {string} url
174
+ * @returns {string | undefined}
175
+ */
176
+ read_resource(containing_file, url) {
177
+ const ptr0 = passStringToWasm0(containing_file, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
178
+ const len0 = WASM_VECTOR_LEN;
179
+ const ptr1 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
180
+ const len1 = WASM_VECTOR_LEN;
181
+ const ret = wasm.wasmanalyzer_read_resource(this.__wbg_ptr, ptr0, len0, ptr1, len1);
182
+ let v3;
183
+ if (ret[0] !== 0) {
184
+ v3 = getStringFromWasm0(ret[0], ret[1]).slice();
185
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
186
+ }
187
+ return v3;
188
+ }
189
+ /**
190
+ * @param {string} updates_json
191
+ * @returns {string}
192
+ */
193
+ update_file_content(updates_json) {
194
+ let deferred3_0;
195
+ let deferred3_1;
196
+ try {
197
+ const ptr0 = passStringToWasm0(updates_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
198
+ const len0 = WASM_VECTOR_LEN;
199
+ const ret = wasm.wasmanalyzer_update_file_content(this.__wbg_ptr, ptr0, len0);
200
+ var ptr2 = ret[0];
201
+ var len2 = ret[1];
202
+ if (ret[3]) {
203
+ ptr2 = 0; len2 = 0;
204
+ throw takeFromExternrefTable0(ret[2]);
205
+ }
206
+ deferred3_0 = ptr2;
207
+ deferred3_1 = len2;
208
+ return getStringFromWasm0(ptr2, len2);
209
+ } finally {
210
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
211
+ }
212
+ }
213
+ }
214
+ if (Symbol.dispose) WasmAnalyzer.prototype[Symbol.dispose] = WasmAnalyzer.prototype.free;
215
+ exports.WasmAnalyzer = WasmAnalyzer;
216
+ function __wbg_get_imports() {
217
+ const import0 = {
218
+ __proto__: null,
219
+ __wbg___wbindgen_boolean_get_2304fb8c853028c8: function(arg0) {
220
+ const v = arg0;
221
+ const ret = typeof(v) === 'boolean' ? v : undefined;
222
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
223
+ },
224
+ __wbg___wbindgen_debug_string_edece8177ad01481: function(arg0, arg1) {
225
+ const ret = debugString(arg1);
226
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
227
+ const len1 = WASM_VECTOR_LEN;
228
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
229
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
230
+ },
231
+ __wbg___wbindgen_is_null_2042690d351e14f0: function(arg0) {
232
+ const ret = arg0 === null;
233
+ return ret;
234
+ },
235
+ __wbg___wbindgen_is_undefined_35bb9f4c7fd651d5: function(arg0) {
236
+ const ret = arg0 === undefined;
237
+ return ret;
238
+ },
239
+ __wbg___wbindgen_string_get_d109740c0d18f4d7: function(arg0, arg1) {
240
+ const obj = arg1;
241
+ const ret = typeof(obj) === 'string' ? obj : undefined;
242
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
243
+ var len1 = WASM_VECTOR_LEN;
244
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
245
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
246
+ },
247
+ __wbg___wbindgen_throw_9c31b086c2b26051: function(arg0, arg1) {
248
+ throw new Error(getStringFromWasm0(arg0, arg1));
249
+ },
250
+ __wbg_canonicalize_340920d4ffabb5d7: function() { return handleError(function (arg0, arg1, arg2) {
251
+ const ret = arg0.canonicalize(getStringFromWasm0(arg1, arg2));
252
+ return ret;
253
+ }, arguments); },
254
+ __wbg_from_fa561fa561dc8031: function(arg0) {
255
+ const ret = Array.from(arg0);
256
+ return ret;
257
+ },
258
+ __wbg_get_dcf82ab8aad1a593: function() { return handleError(function (arg0, arg1) {
259
+ const ret = Reflect.get(arg0, arg1);
260
+ return ret;
261
+ }, arguments); },
262
+ __wbg_get_unchecked_1dfe6d05ad91d9b7: function(arg0, arg1) {
263
+ const ret = arg0[arg1 >>> 0];
264
+ return ret;
265
+ },
266
+ __wbg_length_2591a0f4f659a55c: function(arg0) {
267
+ const ret = arg0.length;
268
+ return ret;
269
+ },
270
+ __wbg_length_56fcd3e2b7e0299d: function(arg0) {
271
+ const ret = arg0.length;
272
+ return ret;
273
+ },
274
+ __wbg_metadata_9dbea9662d5b857f: function() { return handleError(function (arg0, arg1, arg2) {
275
+ const ret = arg0.metadata(getStringFromWasm0(arg1, arg2));
276
+ return ret;
277
+ }, arguments); },
278
+ __wbg_new_7ddec6de44ff8f5d: function(arg0) {
279
+ const ret = new Uint8Array(arg0);
280
+ return ret;
281
+ },
282
+ __wbg_prototypesetcall_5f9bdc8d75e07276: function(arg0, arg1, arg2) {
283
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
284
+ },
285
+ __wbg_readDir_142b210d10f8f3d2: function() { return handleError(function (arg0, arg1, arg2) {
286
+ const ret = arg0.readDir(getStringFromWasm0(arg1, arg2));
287
+ return ret;
288
+ }, arguments); },
289
+ __wbg_readLink_78ad4263ae7a3799: function() { return handleError(function (arg0, arg1, arg2) {
290
+ const ret = arg0.readLink(getStringFromWasm0(arg1, arg2));
291
+ return ret;
292
+ }, arguments); },
293
+ __wbg_read_7626d62703703c40: function() { return handleError(function (arg0, arg1, arg2) {
294
+ const ret = arg0.read(getStringFromWasm0(arg1, arg2));
295
+ return ret;
296
+ }, arguments); },
297
+ __wbg_symlinkMetadata_0b868d79fad776f9: function() { return handleError(function (arg0, arg1, arg2) {
298
+ const ret = arg0.symlinkMetadata(getStringFromWasm0(arg1, arg2));
299
+ return ret;
300
+ }, arguments); },
301
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
302
+ // Cast intrinsic for `Ref(String) -> Externref`.
303
+ const ret = getStringFromWasm0(arg0, arg1);
304
+ return ret;
305
+ },
306
+ __wbindgen_init_externref_table: function() {
307
+ const table = wasm.__wbindgen_externrefs;
308
+ const offset = table.grow(4);
309
+ table.set(0, undefined);
310
+ table.set(offset + 0, undefined);
311
+ table.set(offset + 1, null);
312
+ table.set(offset + 2, true);
313
+ table.set(offset + 3, false);
314
+ },
315
+ };
316
+ return {
317
+ __proto__: null,
318
+ "./ng_analyze_bg.js": import0,
319
+ };
320
+ }
321
+
322
+ const WasmAnalyzerFinalization = (typeof FinalizationRegistry === 'undefined')
323
+ ? { register: () => {}, unregister: () => {} }
324
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmanalyzer_free(ptr, 1));
325
+
326
+ function addToExternrefTable0(obj) {
327
+ const idx = wasm.__externref_table_alloc();
328
+ wasm.__wbindgen_externrefs.set(idx, obj);
329
+ return idx;
330
+ }
331
+
332
+ function debugString(val) {
333
+ // primitive types
334
+ const type = typeof val;
335
+ if (type == 'number' || type == 'boolean' || val == null) {
336
+ return `${val}`;
337
+ }
338
+ if (type == 'string') {
339
+ return `"${val}"`;
340
+ }
341
+ if (type == 'symbol') {
342
+ const description = val.description;
343
+ if (description == null) {
344
+ return 'Symbol';
345
+ } else {
346
+ return `Symbol(${description})`;
347
+ }
348
+ }
349
+ if (type == 'function') {
350
+ const name = val.name;
351
+ if (typeof name == 'string' && name.length > 0) {
352
+ return `Function(${name})`;
353
+ } else {
354
+ return 'Function';
355
+ }
356
+ }
357
+ // objects
358
+ if (Array.isArray(val)) {
359
+ const length = val.length;
360
+ let debug = '[';
361
+ if (length > 0) {
362
+ debug += debugString(val[0]);
363
+ }
364
+ for(let i = 1; i < length; i++) {
365
+ debug += ', ' + debugString(val[i]);
366
+ }
367
+ debug += ']';
368
+ return debug;
369
+ }
370
+ // Test for built-in
371
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
372
+ let className;
373
+ if (builtInMatches && builtInMatches.length > 1) {
374
+ className = builtInMatches[1];
375
+ } else {
376
+ // Failed to match the standard '[object ClassName]'
377
+ return toString.call(val);
378
+ }
379
+ if (className == 'Object') {
380
+ // we're a user defined class or Object
381
+ // JSON.stringify avoids problems with cycles, and is generally much
382
+ // easier than looping through ownProperties of `val`.
383
+ try {
384
+ return 'Object(' + JSON.stringify(val) + ')';
385
+ } catch (_) {
386
+ return 'Object';
387
+ }
388
+ }
389
+ // errors
390
+ if (val instanceof Error) {
391
+ return `${val.name}: ${val.message}\n${val.stack}`;
392
+ }
393
+ // TODO we could test for more things here, like `Set`s and `Map`s.
394
+ return className;
395
+ }
396
+
397
+ function getArrayU8FromWasm0(ptr, len) {
398
+ ptr = ptr >>> 0;
399
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
400
+ }
401
+
402
+ let cachedDataViewMemory0 = null;
403
+ function getDataViewMemory0() {
404
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
405
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
406
+ }
407
+ return cachedDataViewMemory0;
408
+ }
409
+
410
+ function getStringFromWasm0(ptr, len) {
411
+ return decodeText(ptr >>> 0, len);
412
+ }
413
+
414
+ let cachedUint8ArrayMemory0 = null;
415
+ function getUint8ArrayMemory0() {
416
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
417
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
418
+ }
419
+ return cachedUint8ArrayMemory0;
420
+ }
421
+
422
+ function handleError(f, args) {
423
+ try {
424
+ return f.apply(this, args);
425
+ } catch (e) {
426
+ const idx = addToExternrefTable0(e);
427
+ wasm.__wbindgen_exn_store(idx);
428
+ }
429
+ }
430
+
431
+ function isLikeNone(x) {
432
+ return x === undefined || x === null;
433
+ }
434
+
435
+ function passStringToWasm0(arg, malloc, realloc) {
436
+ if (realloc === undefined) {
437
+ const buf = cachedTextEncoder.encode(arg);
438
+ const ptr = malloc(buf.length, 1) >>> 0;
439
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
440
+ WASM_VECTOR_LEN = buf.length;
441
+ return ptr;
442
+ }
443
+
444
+ let len = arg.length;
445
+ let ptr = malloc(len, 1) >>> 0;
446
+
447
+ const mem = getUint8ArrayMemory0();
448
+
449
+ let offset = 0;
450
+
451
+ for (; offset < len; offset++) {
452
+ const code = arg.charCodeAt(offset);
453
+ if (code > 0x7F) break;
454
+ mem[ptr + offset] = code;
455
+ }
456
+ if (offset !== len) {
457
+ if (offset !== 0) {
458
+ arg = arg.slice(offset);
459
+ }
460
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
461
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
462
+ const ret = cachedTextEncoder.encodeInto(arg, view);
463
+
464
+ offset += ret.written;
465
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
466
+ }
467
+
468
+ WASM_VECTOR_LEN = offset;
469
+ return ptr;
470
+ }
471
+
472
+ function takeFromExternrefTable0(idx) {
473
+ const value = wasm.__wbindgen_externrefs.get(idx);
474
+ wasm.__externref_table_dealloc(idx);
475
+ return value;
476
+ }
477
+
478
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
479
+ cachedTextDecoder.decode();
480
+ function decodeText(ptr, len) {
481
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
482
+ }
483
+
484
+ const cachedTextEncoder = new TextEncoder();
485
+
486
+ if (!('encodeInto' in cachedTextEncoder)) {
487
+ cachedTextEncoder.encodeInto = function (arg, view) {
488
+ const buf = cachedTextEncoder.encode(arg);
489
+ view.set(buf);
490
+ return {
491
+ read: arg.length,
492
+ written: buf.length
493
+ };
494
+ };
495
+ }
496
+
497
+ let WASM_VECTOR_LEN = 0;
498
+
499
+ const wasmPath = `${__dirname}/ng_analyze_bg.wasm`;
500
+ const wasmBytes = require('fs').readFileSync(wasmPath);
501
+ const wasmModule = new WebAssembly.Module(wasmBytes);
502
+ let wasmInstance = new WebAssembly.Instance(wasmModule, __wbg_get_imports());
503
+ let wasm = wasmInstance.exports;
504
+ wasm.__wbindgen_start();
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@analogjs/vite-plugin-angular",
3
- "version": "3.0.0-beta.3",
3
+ "version": "3.0.0-beta.31",
4
4
  "description": "Vite Plugin for Angular",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -1,5 +1,5 @@
1
1
  import { JavaScriptTransformer } from "./utils/devkit.js";
2
- import { isProdMode } from "./utils/plugin-config.js";
2
+ import { isProdMode, isServerEnvironment } from "./utils/plugin-config.js";
3
3
  //#region packages/vite-plugin-angular/src/lib/angular-build-optimizer-plugin.ts
4
4
  function buildOptimizerPlugin({ jit }) {
5
5
  const transformers = /* @__PURE__ */ new Map();
@@ -33,8 +33,11 @@ function buildOptimizerPlugin({ jit }) {
33
33
  ngServerMode: `${!!userConfig.build?.ssr}`
34
34
  } : {} };
35
35
  },
36
- configEnvironment(_name, config) {
37
- if (isProd && config.consumer === "server") return { define: { ngServerMode: "true" } };
36
+ configEnvironment: {
37
+ order: "post",
38
+ handler(name, config) {
39
+ if (isProd && isServerEnvironment(name, config)) return { define: { ngServerMode: "true" } };
40
+ }
38
41
  },
39
42
  configResolved(config) {
40
43
  preserveVendorMaps = !!config.build.sourcemap;
@@ -1 +1 @@
1
- {"version":3,"file":"angular-build-optimizer-plugin.js","names":[],"sources":["../../../src/lib/angular-build-optimizer-plugin.ts"],"sourcesContent":["import type { Plugin, UserConfig } from 'vite';\nimport { JavaScriptTransformer } from './utils/devkit.js';\nimport { isProdMode } from './utils/plugin-config.js';\n\nexport function buildOptimizerPlugin({ jit }: { jit: boolean }): Plugin {\n const transformers = new Map<\n string,\n InstanceType<typeof JavaScriptTransformer>\n >();\n let isProd = false;\n let isWatch = false;\n let preserveVendorMaps = false;\n\n function getTransformer(envName = 'default') {\n let transformer = transformers.get(envName);\n if (!transformer) {\n transformer = new JavaScriptTransformer(\n {\n sourcemap: preserveVendorMaps,\n thirdPartySourcemaps: preserveVendorMaps,\n advancedOptimizations: isProd,\n jit: true,\n },\n 1,\n );\n transformers.set(envName, transformer);\n }\n return transformer;\n }\n\n return {\n name: '@analogjs/vite-plugin-angular-optimizer',\n // Normally build-only. Astro's Cloudflare integration (`@astrojs/cloudflare`)\n // transforms SSR modules through a serve-style `workerd` runner *during*\n // `astro build`; an `apply: 'build'` plugin is excluded from that pipeline,\n // so the Angular linker never runs on the worker's partially-compiled\n // packages and they fall back to the JIT compiler. Also apply under a\n // production `NODE_ENV` (which `astro build` sets) so the linker runs in\n // that runner too. Regular Analog dev servers run with a development\n // `NODE_ENV`, so their behavior is unchanged.\n apply(_config, env) {\n return (\n env.command === 'build' || process.env['NODE_ENV'] === 'production'\n );\n },\n config(userConfig) {\n isProd = isProdMode(userConfig.mode);\n // Advanced optimizations paired with dev-mode defines would strip\n // dev-only code the debug API needs, so both key off `isProd`.\n return {\n define: isProd\n ? {\n ngJitMode: 'false',\n ngI18nClosureMode: 'false',\n ngDevMode: 'false',\n ngServerMode: `${!!userConfig.build?.ssr}`,\n }\n : {},\n } as UserConfig;\n },\n // The top-level define keys `ngServerMode` off the legacy `build.ssr`\n // flag. Environment API builds run the server through an environment\n // with `consumer: 'server'` while `build.ssr` stays unset, so give that\n // environment its own value; otherwise the guard compiles to `false`\n // and browser-only hydration features run during SSR.\n configEnvironment(_name, config) {\n if (isProd && config.consumer === 'server') {\n return { define: { ngServerMode: 'true' } };\n }\n return undefined;\n },\n configResolved(config) {\n preserveVendorMaps = !!config.build.sourcemap;\n isWatch = config.command === 'serve' || !!config.build?.watch;\n },\n transform: {\n filter: {\n // Allow an optional `?query` after the extension. Some environments\n // (e.g. Cloudflare's `workerd`, used by Astro's Cloudflare integration)\n // reference optimized deps with a `?v=<hash>` suffix, e.g.\n // `.../fesm2022/_platform_location-chunk.mjs?v=a786a9ff`. A `$`-anchored\n // extension match skips those, so the Angular linker never runs and the\n // partially-compiled package falls back to the JIT compiler at runtime.\n id: /\\.[cm]?js(?:\\?|$)/,\n },\n async handler(code, id) {\n // Strip the `?query` so the fesm check and the transformer see a real\n // filename rather than `foo.mjs?v=<hash>`.\n const cleanId = id.split('?')[0];\n const angularPackage = /fesm20/.test(cleanId);\n\n if (!angularPackage) {\n // `{ mappings: '' }` declares zero segments, dropping the module's own\n // map from the chain; `null` keeps it. Removing `sourceMappingURL` is\n // what makes that map unreachable, so it only runs when discarding.\n return {\n code:\n isProd && !preserveVendorMaps\n ? code.replace(/^\\/\\/# sourceMappingURL=[^\\r\\n]*/gm, '')\n : code,\n map: preserveVendorMaps ? null : { mappings: '' },\n };\n }\n\n const sideEffects =\n jit && cleanId.includes('@angular/compiler') ? true : false;\n const envName = this.environment?.name ?? 'default';\n const transformer = getTransformer(envName);\n const result: Uint8Array = await transformer.transformData(\n cleanId,\n code,\n false,\n sideEffects,\n );\n\n const transformed = Buffer.from(result).toString();\n return preserveVendorMaps\n ? extractInlineSourceMap(transformed, cleanId)\n : { code: transformed, map: { mappings: '' } };\n },\n },\n async closeBundle() {\n if (isWatch) {\n return;\n }\n const envName = this.environment?.name ?? 'default';\n const transformer = transformers.get(envName);\n if (transformer) {\n transformers.delete(envName);\n await transformer.close();\n }\n },\n };\n}\n\nexport function extractInlineSourceMap(\n code: string,\n id: string,\n): { code: string; map: string | null } {\n const sourceMapMatch = code.match(\n /\\n?\\/\\/# sourceMappingURL=data:application\\/json(?:;charset=[^;,]+)?;base64,([A-Za-z0-9+/=]+)\\s*$/,\n );\n if (!sourceMapMatch || sourceMapMatch.index === undefined) {\n return {\n code,\n map: null,\n };\n }\n return {\n code: code.slice(0, sourceMapMatch.index),\n map: Buffer.from(sourceMapMatch[1]!, 'base64').toString(),\n };\n}\n"],"mappings":";;;AAIA,SAAgB,qBAAqB,EAAE,OAAiC;CACtE,MAAM,+BAAe,IAAI,IAGvB;CACF,IAAI,SAAS;CACb,IAAI,UAAU;CACd,IAAI,qBAAqB;CAEzB,SAAS,eAAe,UAAU,WAAW;EAC3C,IAAI,cAAc,aAAa,IAAI,OAAO;EAC1C,IAAI,CAAC,aAAa;GAChB,cAAc,IAAI,sBAChB;IACE,WAAW;IACX,sBAAsB;IACtB,uBAAuB;IACvB,KAAK;GACP,GACA,CACF;GACA,aAAa,IAAI,SAAS,WAAW;EACvC;EACA,OAAO;CACT;CAEA,OAAO;EACL,MAAM;EASN,MAAM,SAAS,KAAK;GAClB,OACE,IAAI,YAAY,WAAA,QAAA,IAAA,aAAuC;EAE3D;EACA,OAAO,YAAY;GACjB,SAAS,WAAW,WAAW,IAAI;GAGnC,OAAO,EACL,QAAQ,SACJ;IACE,WAAW;IACX,mBAAmB;IACnB,WAAW;IACX,cAAc,GAAG,CAAC,CAAC,WAAW,OAAO;GACvC,IACA,CAAC,EACP;EACF;EAMA,kBAAkB,OAAO,QAAQ;GAC/B,IAAI,UAAU,OAAO,aAAa,UAChC,OAAO,EAAE,QAAQ,EAAE,cAAc,OAAO,EAAE;EAG9C;EACA,eAAe,QAAQ;GACrB,qBAAqB,CAAC,CAAC,OAAO,MAAM;GACpC,UAAU,OAAO,YAAY,WAAW,CAAC,CAAC,OAAO,OAAO;EAC1D;EACA,WAAW;GACT,QAAQ,EAON,IAAI,oBACN;GACA,MAAM,QAAQ,MAAM,IAAI;IAGtB,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,CAAC;IAG9B,IAAI,CAFmB,SAAS,KAAK,OAEhC,GAIH,OAAO;KACL,MACE,UAAU,CAAC,qBACP,KAAK,QAAQ,sCAAsC,EAAE,IACrD;KACN,KAAK,qBAAqB,OAAO,EAAE,UAAU,GAAG;IAClD;IAGF,MAAM,cACJ,OAAO,QAAQ,SAAS,mBAAmB,IAAI,OAAO;IAGxD,MAAM,SAAqB,MADP,eADJ,KAAK,aAAa,QAAQ,SAET,CAAA,CAAY,cAC3C,SACA,MACA,OACA,WACF;IAEA,MAAM,cAAc,OAAO,KAAK,MAAM,CAAC,CAAC,SAAS;IACjD,OAAO,qBACH,uBAAuB,aAAa,OAAO,IAC3C;KAAE,MAAM;KAAa,KAAK,EAAE,UAAU,GAAG;IAAE;GACjD;EACF;EACA,MAAM,cAAc;GAClB,IAAI,SACF;GAEF,MAAM,UAAU,KAAK,aAAa,QAAQ;GAC1C,MAAM,cAAc,aAAa,IAAI,OAAO;GAC5C,IAAI,aAAa;IACf,aAAa,OAAO,OAAO;IAC3B,MAAM,YAAY,MAAM;GAC1B;EACF;CACF;AACF;AAEA,SAAgB,uBACd,MACA,IACsC;CACtC,MAAM,iBAAiB,KAAK,MAC1B,mGACF;CACA,IAAI,CAAC,kBAAkB,eAAe,UAAU,KAAA,GAC9C,OAAO;EACL;EACA,KAAK;CACP;CAEF,OAAO;EACL,MAAM,KAAK,MAAM,GAAG,eAAe,KAAK;EACxC,KAAK,OAAO,KAAK,eAAe,IAAK,QAAQ,CAAC,CAAC,SAAS;CAC1D;AACF"}
1
+ {"version":3,"file":"angular-build-optimizer-plugin.js","names":[],"sources":["../../../src/lib/angular-build-optimizer-plugin.ts"],"sourcesContent":["import type { Plugin, UserConfig } from 'vite';\nimport { JavaScriptTransformer } from './utils/devkit.js';\nimport { isProdMode, isServerEnvironment } from './utils/plugin-config.js';\n\nexport function buildOptimizerPlugin({ jit }: { jit: boolean }): Plugin {\n const transformers = new Map<\n string,\n InstanceType<typeof JavaScriptTransformer>\n >();\n let isProd = false;\n let isWatch = false;\n let preserveVendorMaps = false;\n\n function getTransformer(envName = 'default') {\n let transformer = transformers.get(envName);\n if (!transformer) {\n transformer = new JavaScriptTransformer(\n {\n sourcemap: preserveVendorMaps,\n thirdPartySourcemaps: preserveVendorMaps,\n advancedOptimizations: isProd,\n jit: true,\n },\n 1,\n );\n transformers.set(envName, transformer);\n }\n return transformer;\n }\n\n return {\n name: '@analogjs/vite-plugin-angular-optimizer',\n // Normally build-only. Astro's Cloudflare integration (`@astrojs/cloudflare`)\n // transforms SSR modules through a serve-style `workerd` runner *during*\n // `astro build`; an `apply: 'build'` plugin is excluded from that pipeline,\n // so the Angular linker never runs on the worker's partially-compiled\n // packages and they fall back to the JIT compiler. Also apply under a\n // production `NODE_ENV` (which `astro build` sets) so the linker runs in\n // that runner too. Regular Analog dev servers run with a development\n // `NODE_ENV`, so their behavior is unchanged.\n apply(_config, env) {\n return (\n env.command === 'build' || process.env['NODE_ENV'] === 'production'\n );\n },\n config(userConfig) {\n isProd = isProdMode(userConfig.mode);\n // Advanced optimizations paired with dev-mode defines would strip\n // dev-only code the debug API needs, so both key off `isProd`.\n return {\n define: isProd\n ? {\n ngJitMode: 'false',\n ngI18nClosureMode: 'false',\n ngDevMode: 'false',\n ngServerMode: `${!!userConfig.build?.ssr}`,\n }\n : {},\n } as UserConfig;\n },\n // The top-level define keys `ngServerMode` off the legacy `build.ssr`\n // flag. Environment API builds run the server through a server\n // environment while `build.ssr` stays unset, so give that environment its\n // own value; otherwise the guard compiles to `false` and browser-only\n // hydration features run during SSR. Runs after other plugins' hooks, so\n // a consumer they set is taken into account.\n configEnvironment: {\n order: 'post',\n handler(name, config) {\n if (isProd && isServerEnvironment(name, config)) {\n return { define: { ngServerMode: 'true' } };\n }\n return undefined;\n },\n },\n configResolved(config) {\n preserveVendorMaps = !!config.build.sourcemap;\n isWatch = config.command === 'serve' || !!config.build?.watch;\n },\n transform: {\n filter: {\n // Allow an optional `?query` after the extension. Some environments\n // (e.g. Cloudflare's `workerd`, used by Astro's Cloudflare integration)\n // reference optimized deps with a `?v=<hash>` suffix, e.g.\n // `.../fesm2022/_platform_location-chunk.mjs?v=a786a9ff`. A `$`-anchored\n // extension match skips those, so the Angular linker never runs and the\n // partially-compiled package falls back to the JIT compiler at runtime.\n id: /\\.[cm]?js(?:\\?|$)/,\n },\n async handler(code, id) {\n // Strip the `?query` so the fesm check and the transformer see a real\n // filename rather than `foo.mjs?v=<hash>`.\n const cleanId = id.split('?')[0];\n const angularPackage = /fesm20/.test(cleanId);\n\n if (!angularPackage) {\n // `{ mappings: '' }` declares zero segments, dropping the module's own\n // map from the chain; `null` keeps it. Removing `sourceMappingURL` is\n // what makes that map unreachable, so it only runs when discarding.\n return {\n code:\n isProd && !preserveVendorMaps\n ? code.replace(/^\\/\\/# sourceMappingURL=[^\\r\\n]*/gm, '')\n : code,\n map: preserveVendorMaps ? null : { mappings: '' },\n };\n }\n\n const sideEffects =\n jit && cleanId.includes('@angular/compiler') ? true : false;\n const envName = this.environment?.name ?? 'default';\n const transformer = getTransformer(envName);\n const result: Uint8Array = await transformer.transformData(\n cleanId,\n code,\n false,\n sideEffects,\n );\n\n const transformed = Buffer.from(result).toString();\n return preserveVendorMaps\n ? extractInlineSourceMap(transformed, cleanId)\n : { code: transformed, map: { mappings: '' } };\n },\n },\n async closeBundle() {\n if (isWatch) {\n return;\n }\n const envName = this.environment?.name ?? 'default';\n const transformer = transformers.get(envName);\n if (transformer) {\n transformers.delete(envName);\n await transformer.close();\n }\n },\n };\n}\n\nexport function extractInlineSourceMap(\n code: string,\n id: string,\n): { code: string; map: string | null } {\n const sourceMapMatch = code.match(\n /\\n?\\/\\/# sourceMappingURL=data:application\\/json(?:;charset=[^;,]+)?;base64,([A-Za-z0-9+/=]+)\\s*$/,\n );\n if (!sourceMapMatch || sourceMapMatch.index === undefined) {\n return {\n code,\n map: null,\n };\n }\n return {\n code: code.slice(0, sourceMapMatch.index),\n map: Buffer.from(sourceMapMatch[1]!, 'base64').toString(),\n };\n}\n"],"mappings":";;;AAIA,SAAgB,qBAAqB,EAAE,OAAiC;CACtE,MAAM,+BAAe,IAAI,IAGvB;CACF,IAAI,SAAS;CACb,IAAI,UAAU;CACd,IAAI,qBAAqB;CAEzB,SAAS,eAAe,UAAU,WAAW;EAC3C,IAAI,cAAc,aAAa,IAAI,OAAO;EAC1C,IAAI,CAAC,aAAa;GAChB,cAAc,IAAI,sBAChB;IACE,WAAW;IACX,sBAAsB;IACtB,uBAAuB;IACvB,KAAK;GACP,GACA,CACF;GACA,aAAa,IAAI,SAAS,WAAW;EACvC;EACA,OAAO;CACT;CAEA,OAAO;EACL,MAAM;EASN,MAAM,SAAS,KAAK;GAClB,OACE,IAAI,YAAY,WAAA,QAAA,IAAA,aAAuC;EAE3D;EACA,OAAO,YAAY;GACjB,SAAS,WAAW,WAAW,IAAI;GAGnC,OAAO,EACL,QAAQ,SACJ;IACE,WAAW;IACX,mBAAmB;IACnB,WAAW;IACX,cAAc,GAAG,CAAC,CAAC,WAAW,OAAO;GACvC,IACA,CAAC,EACP;EACF;EAOA,mBAAmB;GACjB,OAAO;GACP,QAAQ,MAAM,QAAQ;IACpB,IAAI,UAAU,oBAAoB,MAAM,MAAM,GAC5C,OAAO,EAAE,QAAQ,EAAE,cAAc,OAAO,EAAE;GAG9C;EACF;EACA,eAAe,QAAQ;GACrB,qBAAqB,CAAC,CAAC,OAAO,MAAM;GACpC,UAAU,OAAO,YAAY,WAAW,CAAC,CAAC,OAAO,OAAO;EAC1D;EACA,WAAW;GACT,QAAQ,EAON,IAAI,oBACN;GACA,MAAM,QAAQ,MAAM,IAAI;IAGtB,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,CAAC;IAG9B,IAAI,CAFmB,SAAS,KAAK,OAEhC,GAIH,OAAO;KACL,MACE,UAAU,CAAC,qBACP,KAAK,QAAQ,sCAAsC,EAAE,IACrD;KACN,KAAK,qBAAqB,OAAO,EAAE,UAAU,GAAG;IAClD;IAGF,MAAM,cACJ,OAAO,QAAQ,SAAS,mBAAmB,IAAI,OAAO;IAGxD,MAAM,SAAqB,MADP,eADJ,KAAK,aAAa,QAAQ,SAET,CAAA,CAAY,cAC3C,SACA,MACA,OACA,WACF;IAEA,MAAM,cAAc,OAAO,KAAK,MAAM,CAAC,CAAC,SAAS;IACjD,OAAO,qBACH,uBAAuB,aAAa,OAAO,IAC3C;KAAE,MAAM;KAAa,KAAK,EAAE,UAAU,GAAG;IAAE;GACjD;EACF;EACA,MAAM,cAAc;GAClB,IAAI,SACF;GAEF,MAAM,UAAU,KAAK,aAAa,QAAQ;GAC1C,MAAM,cAAc,aAAa,IAAI,OAAO;GAC5C,IAAI,aAAa;IACf,aAAa,OAAO,OAAO;IAC3B,MAAM,YAAY,MAAM;GAC1B;EACF;CACF;AACF;AAEA,SAAgB,uBACd,MACA,IACsC;CACtC,MAAM,iBAAiB,KAAK,MAC1B,mGACF;CACA,IAAI,CAAC,kBAAkB,eAAe,UAAU,KAAA,GAC9C,OAAO;EACL;EACA,KAAK;CACP;CAEF,OAAO;EACL,MAAM,KAAK,MAAM,GAAG,eAAe,KAAK;EACxC,KAAK,OAAO,KAAK,eAAe,IAAK,QAAQ,CAAC,CAAC,SAAS;CAC1D;AACF"}
@@ -5,6 +5,7 @@ import { type DebugOption } from "./utils/debug.js";
5
5
  import { FileReplacement } from "./plugins/file-replacements.plugin.js";
6
6
  import { AnalogStylesheetRegistry } from "./stylesheet-registry.js";
7
7
  export { DiagnosticModes, injectViteIgnoreForHmrMetadata, isIgnoredHmrFile, toAngularCompilationFileReplacements, mapTemplateUpdatesToFiles, refreshStylesheetRegistryForFile, describeStylesheetContent, isTestWatchMode, getBrowserModeCliOverride } from "./utils/compilation-shared.js";
8
+ import type { TypeCheckerOption } from "./utils/lsp-type-checker.js";
8
9
  export interface PluginOptions {
9
10
  /**
10
11
  * Path to the tsconfig used for compilation, or a function returning it.
@@ -37,28 +38,42 @@ export interface PluginOptions {
37
38
  * This is separate from Vite's `server.hmr` option, which configures the
38
39
  * HMR client transport.
39
40
  *
40
- * Defaults to `true` for watch mode. Set to `false` to disable Angular
41
- * reload updates while keeping other stylesheet externalization behavior
42
- * available when needed.
41
+ * Defaults to `true` for watch mode, or `false` with `compilation: 'ngp'`,
42
+ * which reloads the page on every change unless this is `true`. Set to
43
+ * `false` to disable Angular reload updates while keeping other stylesheet
44
+ * externalization behavior available when needed.
43
45
  */
44
46
  liveReload?: boolean;
45
47
  /**
46
48
  * Skip semantic and Angular template diagnostics during compilation.
47
- * Defaults to `true`.
49
+ * Defaults to `true`, or `false` with `compilation: 'ngp'`, which requires
50
+ * a TypeScript 7 type checker (see `typeChecker`).
48
51
  */
49
52
  disableTypeChecking?: boolean;
50
53
  /**
54
+ * TypeScript 7 type checker used with `compilation: 'ngp'`: `'tsgo'`
55
+ * (default), `'tsrs'`, or a command serving the TypeScript 7 language
56
+ * server over stdio (`args` defaults to `['--lsp', '--stdio']`).
57
+ */
58
+ typeChecker?: TypeCheckerOption;
59
+ /**
51
60
  * Replace source files at build time, like `fileReplacements` in
52
61
  * `angular.json`.
53
62
  */
54
63
  fileReplacements?: FileReplacement[];
55
64
  /**
56
65
  * Opt into the fast compile path. Skips Angular's template type-checking
57
- * and routes compilation through an internal single-pass transform.
66
+ * and routes compilation through an internal single-pass transform when
67
+ * `compilation` is not specified.
58
68
  * Defaults to `false`.
59
69
  */
60
70
  fastCompile?: boolean;
61
71
  /**
72
+ * Selects the compilation path, overriding fastCompile. Defaults to 'ngtsc';
73
+ * 'ngp' is experimental and falls back to 'ngtsc' under Vitest's JIT default.
74
+ */
75
+ compilation?: "ngtsc" | "ngp";
76
+ /**
62
77
  * Compilation output mode used when `fastCompile` is enabled.
63
78
  * - `'full'` (default): Emit final Ivy definitions for application builds.
64
79
  * - `'partial'`: Emit partial declarations for library publishing.