@qwik.dev/core 2.0.0-alpha.9 → 2.0.0-beta.10
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.
- package/bindings/qwik.darwin-arm64.node +0 -0
- package/bindings/qwik.darwin-x64.node +0 -0
- package/bindings/qwik.linux-x64-gnu.node +0 -0
- package/bindings/qwik.wasm.cjs +27 -27
- package/bindings/qwik.wasm.mjs +27 -27
- package/bindings/qwik.win32-x64-msvc.node +0 -0
- package/bindings/qwik_wasm_bg.wasm +0 -0
- package/dist/backpatch/index.cjs +6 -0
- package/dist/backpatch/index.d.ts +2 -0
- package/dist/backpatch/index.mjs +5 -0
- package/dist/{prefetch → backpatch}/package.json +2 -2
- package/dist/backpatch-executor.debug.js +34 -0
- package/dist/backpatch-executor.js +1 -0
- package/dist/build/index.cjs +3 -3
- package/dist/build/index.d.ts +22 -22
- package/dist/build/package.json +1 -1
- package/dist/cli.cjs +3035 -767
- package/dist/core-internal.d.ts +4622 -4153
- package/dist/core.cjs +7327 -6169
- package/dist/core.cjs.map +1 -1
- package/dist/core.min.mjs +1 -1
- package/dist/core.mjs +7294 -6163
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.cjs +3209 -2612
- package/dist/core.prod.mjs +3932 -3294
- package/dist/insights/index.qwik.cjs +1 -4142
- package/dist/insights/index.qwik.mjs +63 -4133
- package/dist/insights/vite/index.cjs +1 -82
- package/dist/insights/vite/index.mjs +65 -37
- package/dist/insights/vite.d.ts +22 -0
- package/dist/{insights/insights.d.ts → insights.d.ts} +33 -22
- package/dist/loader/index.cjs +2 -2
- package/dist/loader/index.mjs +2 -2
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.cjs +201 -3817
- package/dist/optimizer.d.ts +754 -707
- package/dist/optimizer.mjs +2605 -3628
- package/dist/preloader.cjs +266 -0
- package/dist/preloader.mjs +195 -0
- package/dist/qwikloader.debug.js +228 -222
- package/dist/qwikloader.js +1 -3
- package/dist/server.cjs +915 -621
- package/dist/server.d.ts +519 -402
- package/dist/server.mjs +900 -615
- package/dist/starters/adapters/aws-lambda/adapters/aws-lambda/vite.config.mts +1 -1
- package/dist/starters/adapters/aws-lambda/package.json +1 -1
- package/dist/starters/adapters/aws-lambda/serverless.yml +15 -0
- package/dist/starters/adapters/aws-lambda/src/entry_aws-lambda.tsx +2 -8
- package/dist/starters/adapters/azure-swa/adapters/azure-swa/vite.config.mts +1 -1
- package/dist/starters/adapters/azure-swa/package.json +1 -1
- package/dist/starters/adapters/azure-swa/public/staticwebapp.config.json +7 -0
- package/dist/starters/adapters/azure-swa/src/entry.azure-swa.tsx +2 -4
- package/dist/starters/adapters/bun/adapters/bun/vite.config.mts +2 -2
- package/dist/starters/adapters/bun/package.json +1 -1
- package/dist/starters/adapters/bun/src/entry.bun.ts +3 -4
- package/dist/starters/adapters/cloud-run/adapters/cloud-run/vite.config.mts +1 -1
- package/dist/starters/adapters/cloud-run/package.json +1 -1
- package/dist/starters/adapters/cloud-run/src/entry.cloud-run.tsx +2 -6
- package/dist/starters/adapters/cloudflare-pages/adapters/cloudflare-pages/vite.config.mts +1 -1
- package/dist/starters/adapters/cloudflare-pages/package.json +1 -1
- package/dist/starters/adapters/cloudflare-pages/public/_headers +2 -0
- package/dist/starters/adapters/cloudflare-pages/src/entry.cloudflare-pages.tsx +2 -4
- package/dist/starters/adapters/deno/adapters/deno/vite.config.mts +1 -1
- package/dist/starters/adapters/deno/package.json +1 -1
- package/dist/starters/adapters/deno/src/entry.deno.ts +3 -4
- package/dist/starters/adapters/express/adapters/express/vite.config.mts +1 -1
- package/dist/starters/adapters/express/package.json +1 -1
- package/dist/starters/adapters/express/src/entry.express.tsx +6 -5
- package/dist/starters/adapters/fastify/adapters/fastify/vite.config.mts +1 -1
- package/dist/starters/adapters/fastify/package.json +1 -1
- package/dist/starters/adapters/fastify/src/entry.fastify.tsx +3 -2
- package/dist/starters/adapters/fastify/src/plugins/fastify-qwik.ts +10 -3
- package/dist/starters/adapters/firebase/adapters/firebase/vite.config.mts +1 -1
- package/dist/starters/adapters/firebase/firebase.json +12 -1
- package/dist/starters/adapters/firebase/functions/index.js +2 -3
- package/dist/starters/adapters/firebase/package.json +1 -1
- package/dist/starters/adapters/firebase/src/entry-firebase.tsx +2 -4
- package/dist/starters/adapters/netlify-edge/adapters/netlify-edge/vite.config.mts +1 -1
- package/dist/starters/adapters/netlify-edge/package.json +1 -1
- package/dist/starters/adapters/netlify-edge/public/_headers +2 -0
- package/dist/starters/adapters/netlify-edge/src/entry.netlify-edge.tsx +2 -4
- package/dist/starters/adapters/node-server/adapters/node-server/vite.config.mts +1 -1
- package/dist/starters/adapters/node-server/package.json +1 -1
- package/dist/starters/adapters/node-server/src/entry.node-server.tsx +3 -4
- package/dist/starters/adapters/ssg/README.md +9 -0
- package/dist/starters/adapters/{static/adapters/static → ssg/adapters/ssg}/vite.config.mts +2 -2
- package/dist/starters/adapters/ssg/package.json +19 -0
- package/dist/starters/adapters/vercel-edge/adapters/vercel-edge/vite.config.mts +1 -1
- package/dist/starters/adapters/vercel-edge/package.json +1 -1
- package/dist/starters/adapters/vercel-edge/src/entry.vercel-edge.tsx +2 -4
- package/dist/starters/adapters/vercel-edge/vercel.json +1 -1
- package/dist/starters/features/auth/package.json +1 -1
- package/dist/starters/features/bootstrap/src/routes/bootstrap/layout.tsx +0 -11
- package/dist/starters/features/csr/index.html +23 -0
- package/dist/starters/features/csr/package.json +29 -0
- package/dist/starters/features/csr/src/root.tsx +15 -0
- package/dist/starters/features/csr/vite.config.mts +13 -0
- package/dist/starters/features/localize/package.json +3 -3
- package/dist/starters/features/localize/src/entry.ssr.tsx +17 -23
- package/dist/starters/features/localize/src/routes/[locale]/i18n-utils.ts +1 -1
- package/dist/starters/features/pandacss/package.json +1 -1
- package/dist/starters/features/partytown/package.json +4 -4
- package/dist/starters/features/partytown/src/components/partytown/partytown.tsx +2 -2
- package/dist/starters/features/playwright/playwright-report/index.html +953 -911
- package/dist/starters/features/postcss/postcss.config.js +2 -2
- package/dist/starters/features/service-worker/package.json +13 -0
- package/dist/starters/features/service-worker/src/routes/service-worker.ts +14 -0
- package/dist/starters/features/styled-vanilla-extract/package.json +2 -1
- package/dist/starters/features/tailwind/package.json +4 -3
- package/dist/starters/features/tailwind/prettier.config.js +10 -0
- package/dist/starters/features/tailwind/src/global.css +1 -1
- package/dist/starters/features/tailwind-v3/package.json +1 -1
- package/dist/starters/features/tailwind-v3/prettier.config.js +10 -0
- package/dist/starters/features/tailwind-v3/tailwind.config.js +2 -2
- package/dist/testing/index.cjs +14313 -11732
- package/dist/testing/index.d.ts +1112 -141
- package/dist/testing/index.mjs +14225 -11661
- package/dist/testing/package.json +1 -1
- package/package.json +28 -14
- package/public.d.ts +5 -0
- package/server.d.ts +1 -0
- package/dist/insights/index.d.ts +0 -1
- package/dist/insights/vite/index.d.ts +0 -1
- package/dist/insights/vite/insights-plugin.d.ts +0 -10
- package/dist/prefetch/index.cjs +0 -4
- package/dist/prefetch/index.d.ts +0 -2
- package/dist/prefetch/index.mjs +0 -3
- package/dist/qwik-prefetch.debug.js +0 -244
- package/dist/qwik-prefetch.js +0 -1
- package/dist/starters/adapters/static/README.md +0 -5
- package/dist/starters/adapters/static/package.json +0 -19
- package/dist/starters/features/tailwind/.prettierrc.js +0 -3
package/dist/optimizer.d.ts
CHANGED
|
@@ -1,707 +1,754 @@
|
|
|
1
|
-
import type { Plugin as Plugin_2 } from 'vite';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/** Enable the
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/** @public */
|
|
91
|
-
export declare type MinifyMode = 'simplify' | 'none';
|
|
92
|
-
|
|
93
|
-
declare interface NormalizedQwikPluginOptions extends Omit<Required<QwikPluginOptions>, 'vendorRoots' | 'experimental'> {
|
|
94
|
-
input: string[] | {
|
|
95
|
-
[entry: string]: string;
|
|
96
|
-
};
|
|
97
|
-
experimental
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/** @public */
|
|
101
|
-
export declare interface Optimizer {
|
|
102
|
-
/** Transforms the input code string, does not access the file system. */
|
|
103
|
-
transformModules(opts: TransformModulesOptions): Promise<TransformOutput>;
|
|
104
|
-
/** Optimizer system use. This can be updated with a custom file system. */
|
|
105
|
-
sys: OptimizerSystem;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/** @public */
|
|
109
|
-
export declare interface OptimizerOptions {
|
|
110
|
-
sys?: OptimizerSystem;
|
|
111
|
-
binding?: any;
|
|
112
|
-
/** Inline the global styles if they're smaller than this */
|
|
113
|
-
inlineStylesUpToBytes?: number;
|
|
114
|
-
/** Enable sourcemaps */
|
|
115
|
-
sourcemap?: boolean;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/** @public */
|
|
119
|
-
export declare interface OptimizerSystem {
|
|
120
|
-
cwd: () => string;
|
|
121
|
-
env: SystemEnvironment;
|
|
122
|
-
os: string;
|
|
123
|
-
dynamicImport: (path: string) => Promise<any>;
|
|
124
|
-
strictDynamicImport: (path: string) => Promise<any>;
|
|
125
|
-
getInputFiles?: (rootDir: string) => Promise<TransformModuleInput[]>;
|
|
126
|
-
path: Path;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Workaround to make the api be defined in the type.
|
|
131
|
-
*
|
|
132
|
-
* @internal
|
|
133
|
-
*/
|
|
134
|
-
declare type P<T> = Plugin_2<T> & {
|
|
135
|
-
api: T;
|
|
136
|
-
config: Extract<Plugin_2<T>['config'], Function>;
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
/** @public */
|
|
140
|
-
export declare interface Path {
|
|
141
|
-
resolve(...paths: string[]): string;
|
|
142
|
-
normalize(path: string): string;
|
|
143
|
-
isAbsolute(path: string): boolean;
|
|
144
|
-
join(...paths: string[]): string;
|
|
145
|
-
relative(from: string, to: string): string;
|
|
146
|
-
dirname(path: string): string;
|
|
147
|
-
basename(path: string, ext?: string): string;
|
|
148
|
-
extname(path: string): string;
|
|
149
|
-
format(pathObject: {
|
|
150
|
-
root: string;
|
|
151
|
-
dir: string;
|
|
152
|
-
base: string;
|
|
153
|
-
ext: string;
|
|
154
|
-
name: string;
|
|
155
|
-
}): string;
|
|
156
|
-
parse(path: string): {
|
|
157
|
-
root: string;
|
|
158
|
-
dir: string;
|
|
159
|
-
base: string;
|
|
160
|
-
ext: string;
|
|
161
|
-
name: string;
|
|
162
|
-
};
|
|
163
|
-
readonly sep: string;
|
|
164
|
-
readonly delimiter: string;
|
|
165
|
-
readonly win32: null;
|
|
166
|
-
readonly posix: Path;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
/** @public */
|
|
170
|
-
export declare
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
*
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
*/
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
* Default `
|
|
332
|
-
*/
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*/
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
*
|
|
342
|
-
*
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
/**
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
/**
|
|
472
|
-
*
|
|
473
|
-
*
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
*
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
*
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
*
|
|
511
|
-
*
|
|
512
|
-
*
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
*
|
|
538
|
-
*
|
|
539
|
-
*
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
*
|
|
566
|
-
*
|
|
567
|
-
*
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
/**
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
export
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
export
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
/** @public */
|
|
660
|
-
export declare interface
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
/** @public */
|
|
672
|
-
export declare interface
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
export {
|
|
1
|
+
import type { Plugin as Plugin_2 } from 'vite';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A function that returns a map of bundle names to their dependencies.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export declare type BundleGraphAdder = (manifest: QwikManifest) => Record<string, {
|
|
9
|
+
imports?: string[];
|
|
10
|
+
dynamicImports?: string[];
|
|
11
|
+
}>;
|
|
12
|
+
|
|
13
|
+
/** @public */
|
|
14
|
+
export declare interface ComponentEntryStrategy {
|
|
15
|
+
type: 'component';
|
|
16
|
+
manual?: Record<string, string>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** @public */
|
|
20
|
+
export declare const createOptimizer: (optimizerOptions?: OptimizerOptions) => Promise<Optimizer>;
|
|
21
|
+
|
|
22
|
+
/** @public */
|
|
23
|
+
export declare interface Diagnostic {
|
|
24
|
+
scope: string;
|
|
25
|
+
category: DiagnosticCategory;
|
|
26
|
+
code: string | null;
|
|
27
|
+
file: string;
|
|
28
|
+
message: string;
|
|
29
|
+
highlights: SourceLocation[] | null;
|
|
30
|
+
suggestions: string[] | null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** @public */
|
|
34
|
+
export declare type DiagnosticCategory = 'error' | 'warning' | 'sourceError';
|
|
35
|
+
|
|
36
|
+
/** @public */
|
|
37
|
+
declare type EmitMode = 'dev' | 'prod' | 'lib';
|
|
38
|
+
|
|
39
|
+
/** @public */
|
|
40
|
+
export declare type EntryStrategy = InlineEntryStrategy | HoistEntryStrategy | SingleEntryStrategy | HookEntryStrategy_2 | SegmentEntryStrategy | ComponentEntryStrategy | SmartEntryStrategy;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Use `__EXPERIMENTAL__.x` to check if feature `x` is enabled. It will be replaced with `true` or
|
|
44
|
+
* `false` via an exact string replacement.
|
|
45
|
+
*
|
|
46
|
+
* Add experimental features to this enum definition.
|
|
47
|
+
*
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
export declare enum ExperimentalFeatures {
|
|
51
|
+
/** Enable the usePreventNavigate hook */
|
|
52
|
+
preventNavigate = "preventNavigate",
|
|
53
|
+
/** Enable the Valibot form validation */
|
|
54
|
+
valibot = "valibot",
|
|
55
|
+
/** Disable SPA navigation handler in Qwik Router */
|
|
56
|
+
noSPA = "noSPA",
|
|
57
|
+
/** Enable request.rewrite() */
|
|
58
|
+
enableRequestRewrite = "enableRequestRewrite",
|
|
59
|
+
/** Enable worker$ */
|
|
60
|
+
webWorker = "webWorker",
|
|
61
|
+
/** Enable the ability to use the Qwik Insights vite plugin and `<Insights/>` component */
|
|
62
|
+
insights = "insights"
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** @public */
|
|
66
|
+
export declare interface GlobalInjections {
|
|
67
|
+
tag: string;
|
|
68
|
+
attributes?: {
|
|
69
|
+
[key: string]: string;
|
|
70
|
+
};
|
|
71
|
+
location: 'head' | 'body';
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** @public */
|
|
75
|
+
declare interface HoistEntryStrategy {
|
|
76
|
+
type: 'hoist';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** @deprecated Use SegmentStrategy instead */
|
|
80
|
+
declare interface HookEntryStrategy_2 {
|
|
81
|
+
type: 'hook';
|
|
82
|
+
manual?: Record<string, string>;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** @public */
|
|
86
|
+
export declare interface InlineEntryStrategy {
|
|
87
|
+
type: 'inline';
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** @public */
|
|
91
|
+
export declare type MinifyMode = 'simplify' | 'none';
|
|
92
|
+
|
|
93
|
+
declare interface NormalizedQwikPluginOptions extends Omit<Required<QwikPluginOptions>, 'input' | 'vendorRoots' | 'srcInputs' | 'experimental'> {
|
|
94
|
+
input: string[] | {
|
|
95
|
+
[entry: string]: string;
|
|
96
|
+
} | undefined;
|
|
97
|
+
experimental: Record<keyof typeof ExperimentalFeatures, boolean> | undefined;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** @public */
|
|
101
|
+
export declare interface Optimizer {
|
|
102
|
+
/** Transforms the input code string, does not access the file system. */
|
|
103
|
+
transformModules(opts: TransformModulesOptions): Promise<TransformOutput>;
|
|
104
|
+
/** Optimizer system use. This can be updated with a custom file system. */
|
|
105
|
+
sys: OptimizerSystem;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** @public */
|
|
109
|
+
export declare interface OptimizerOptions {
|
|
110
|
+
sys?: OptimizerSystem;
|
|
111
|
+
binding?: any;
|
|
112
|
+
/** Inline the global styles if they're smaller than this */
|
|
113
|
+
inlineStylesUpToBytes?: number;
|
|
114
|
+
/** Enable sourcemaps */
|
|
115
|
+
sourcemap?: boolean;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** @public */
|
|
119
|
+
export declare interface OptimizerSystem {
|
|
120
|
+
cwd: () => string;
|
|
121
|
+
env: SystemEnvironment;
|
|
122
|
+
os: string;
|
|
123
|
+
dynamicImport: (path: string) => Promise<any>;
|
|
124
|
+
strictDynamicImport: (path: string) => Promise<any>;
|
|
125
|
+
getInputFiles?: (rootDir: string) => Promise<TransformModuleInput[]>;
|
|
126
|
+
path: Path;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Workaround to make the api be defined in the type.
|
|
131
|
+
*
|
|
132
|
+
* @internal
|
|
133
|
+
*/
|
|
134
|
+
declare type P<T> = Plugin_2<T> & {
|
|
135
|
+
api: T;
|
|
136
|
+
config: Extract<Plugin_2<T>['config'], Function>;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
/** @public */
|
|
140
|
+
export declare interface Path {
|
|
141
|
+
resolve(...paths: string[]): string;
|
|
142
|
+
normalize(path: string): string;
|
|
143
|
+
isAbsolute(path: string): boolean;
|
|
144
|
+
join(...paths: string[]): string;
|
|
145
|
+
relative(from: string, to: string): string;
|
|
146
|
+
dirname(path: string): string;
|
|
147
|
+
basename(path: string, ext?: string): string;
|
|
148
|
+
extname(path: string): string;
|
|
149
|
+
format(pathObject: {
|
|
150
|
+
root: string;
|
|
151
|
+
dir: string;
|
|
152
|
+
base: string;
|
|
153
|
+
ext: string;
|
|
154
|
+
name: string;
|
|
155
|
+
}): string;
|
|
156
|
+
parse(path: string): {
|
|
157
|
+
root: string;
|
|
158
|
+
dir: string;
|
|
159
|
+
base: string;
|
|
160
|
+
ext: string;
|
|
161
|
+
name: string;
|
|
162
|
+
};
|
|
163
|
+
readonly sep: string;
|
|
164
|
+
readonly delimiter: string;
|
|
165
|
+
readonly win32: null;
|
|
166
|
+
readonly posix: Path;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** @public */
|
|
170
|
+
export declare interface QwikAsset {
|
|
171
|
+
/** Name of the asset */
|
|
172
|
+
name: string | undefined;
|
|
173
|
+
/** Size of the asset */
|
|
174
|
+
size: number;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/** @public */
|
|
178
|
+
export declare type QwikBuildMode = 'production' | 'development';
|
|
179
|
+
|
|
180
|
+
/** @public */
|
|
181
|
+
export declare type QwikBuildTarget = 'client' | 'ssr' | 'lib' | 'test';
|
|
182
|
+
|
|
183
|
+
/** @public */
|
|
184
|
+
export declare interface QwikBundle {
|
|
185
|
+
/** Size of the bundle */
|
|
186
|
+
size: number;
|
|
187
|
+
/** Total size of this bundle's static import graph */
|
|
188
|
+
total: number;
|
|
189
|
+
/** Interactivity score of the bundle */
|
|
190
|
+
interactivity?: number;
|
|
191
|
+
/** Symbols in the bundle */
|
|
192
|
+
symbols?: string[];
|
|
193
|
+
/** Direct imports */
|
|
194
|
+
imports?: string[];
|
|
195
|
+
/** Dynamic imports */
|
|
196
|
+
dynamicImports?: string[];
|
|
197
|
+
/** Source files of the bundle */
|
|
198
|
+
origins?: string[];
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Bundle graph.
|
|
203
|
+
*
|
|
204
|
+
* Format: [ 'bundle-a.js', 3, 5 // Depends on 'bundle-b.js' and 'bundle-c.js' 'bundle-b.js', 5, //
|
|
205
|
+
* Depends on 'bundle-c.js' 'bundle-c.js', ]
|
|
206
|
+
*
|
|
207
|
+
* @public
|
|
208
|
+
*/
|
|
209
|
+
export declare type QwikBundleGraph = Array<string | number>;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* The metadata of the build. One of its uses is storing where QRL symbols are located.
|
|
213
|
+
*
|
|
214
|
+
* @public
|
|
215
|
+
*/
|
|
216
|
+
export declare interface QwikManifest {
|
|
217
|
+
/** Content hash of the manifest, if this changes, the code changed */
|
|
218
|
+
manifestHash: string;
|
|
219
|
+
/** QRL symbols */
|
|
220
|
+
symbols: {
|
|
221
|
+
[symbolName: string]: QwikSymbol;
|
|
222
|
+
};
|
|
223
|
+
/** Where QRLs are located. The key is the symbol name, the value is the bundle fileName */
|
|
224
|
+
mapping: {
|
|
225
|
+
[symbolName: string]: string;
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* All code bundles, used to know the import graph. The key is the bundle fileName relative to
|
|
229
|
+
* "build/"
|
|
230
|
+
*/
|
|
231
|
+
bundles: {
|
|
232
|
+
[fileName: string]: QwikBundle;
|
|
233
|
+
};
|
|
234
|
+
/** All assets. The key is the fileName relative to the rootDir */
|
|
235
|
+
assets?: {
|
|
236
|
+
[fileName: string]: QwikAsset;
|
|
237
|
+
};
|
|
238
|
+
/** All bundles in a compact graph format with probabilities */
|
|
239
|
+
bundleGraph?: QwikBundleGraph;
|
|
240
|
+
/** The bundle graph fileName */
|
|
241
|
+
bundleGraphAsset?: string;
|
|
242
|
+
/** The preloader bundle fileName */
|
|
243
|
+
preloader?: string;
|
|
244
|
+
/** The Qwik core bundle fileName */
|
|
245
|
+
core?: string;
|
|
246
|
+
/** The Qwik loader bundle fileName */
|
|
247
|
+
qwikLoader?: string;
|
|
248
|
+
/** CSS etc to inject in the document head */
|
|
249
|
+
injections?: GlobalInjections[];
|
|
250
|
+
/** The version of the manifest */
|
|
251
|
+
version: string;
|
|
252
|
+
/** The options used to build the manifest */
|
|
253
|
+
options?: {
|
|
254
|
+
target?: string;
|
|
255
|
+
buildMode?: string;
|
|
256
|
+
entryStrategy?: {
|
|
257
|
+
type: EntryStrategy['type'];
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
/** The platform used to build the manifest */
|
|
261
|
+
platform?: {
|
|
262
|
+
[name: string]: string;
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
declare interface QwikPluginDevTools {
|
|
267
|
+
imageDevTools?: boolean | true;
|
|
268
|
+
clickToSource?: string[] | false;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
declare interface QwikPluginOptions {
|
|
272
|
+
csr?: boolean;
|
|
273
|
+
buildMode?: QwikBuildMode;
|
|
274
|
+
debug?: boolean;
|
|
275
|
+
entryStrategy?: EntryStrategy;
|
|
276
|
+
rootDir?: string;
|
|
277
|
+
tsconfigFileNames?: string[];
|
|
278
|
+
/** @deprecated No longer used */
|
|
279
|
+
vendorRoots?: string[];
|
|
280
|
+
manifestOutput?: ((manifest: QwikManifest) => Promise<void> | void) | null;
|
|
281
|
+
manifestInput?: QwikManifest | null;
|
|
282
|
+
input?: string[] | string | {
|
|
283
|
+
[entry: string]: string;
|
|
284
|
+
};
|
|
285
|
+
outDir?: string;
|
|
286
|
+
ssrOutDir?: string;
|
|
287
|
+
clientOutDir?: string;
|
|
288
|
+
assetsDir?: string;
|
|
289
|
+
srcDir?: string | null;
|
|
290
|
+
scope?: string | null;
|
|
291
|
+
/** @deprecated Not used */
|
|
292
|
+
srcInputs?: TransformModuleInput[] | null;
|
|
293
|
+
sourcemap?: boolean;
|
|
294
|
+
resolveQwikBuild?: boolean;
|
|
295
|
+
target?: QwikBuildTarget;
|
|
296
|
+
transformedModuleOutput?: ((transformedModules: TransformModule[]) => Promise<void> | void) | null;
|
|
297
|
+
devTools?: QwikPluginDevTools;
|
|
298
|
+
/**
|
|
299
|
+
* Inline styles up to a certain size (in bytes) instead of using a separate file.
|
|
300
|
+
*
|
|
301
|
+
* Default: 20kb (20,000bytes)
|
|
302
|
+
*/
|
|
303
|
+
inlineStylesUpToBytes?: number;
|
|
304
|
+
/**
|
|
305
|
+
* Run eslint on the source files for the ssr build or dev server. This can slow down startup on
|
|
306
|
+
* large projects. Defaults to `true`
|
|
307
|
+
*/
|
|
308
|
+
lint?: boolean;
|
|
309
|
+
/**
|
|
310
|
+
* Experimental features. These can come and go in patch releases, and their API is not guaranteed
|
|
311
|
+
* to be stable between releases.
|
|
312
|
+
*/
|
|
313
|
+
experimental?: (keyof typeof ExperimentalFeatures)[];
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/** @public */
|
|
317
|
+
export declare function qwikRollup(qwikRollupOpts?: QwikRollupPluginOptions): any;
|
|
318
|
+
|
|
319
|
+
/** @public */
|
|
320
|
+
export declare interface QwikRollupPluginOptions {
|
|
321
|
+
csr?: boolean;
|
|
322
|
+
/**
|
|
323
|
+
* Build `production` or `development`.
|
|
324
|
+
*
|
|
325
|
+
* Default `development`
|
|
326
|
+
*/
|
|
327
|
+
buildMode?: QwikBuildMode;
|
|
328
|
+
/**
|
|
329
|
+
* Target `client` or `ssr`.
|
|
330
|
+
*
|
|
331
|
+
* Default `client`
|
|
332
|
+
*/
|
|
333
|
+
target?: QwikBuildTarget;
|
|
334
|
+
/**
|
|
335
|
+
* Prints verbose Qwik plugin debug logs.
|
|
336
|
+
*
|
|
337
|
+
* Default `false`
|
|
338
|
+
*/
|
|
339
|
+
debug?: boolean;
|
|
340
|
+
/**
|
|
341
|
+
* The Qwik entry strategy to use while building for production. During development the type is
|
|
342
|
+
* always `segment`.
|
|
343
|
+
*
|
|
344
|
+
* Default `{ type: "smart" }`)
|
|
345
|
+
*/
|
|
346
|
+
entryStrategy?: EntryStrategy;
|
|
347
|
+
/**
|
|
348
|
+
* The source directory to find all the Qwik components. Since Qwik does not have a single input,
|
|
349
|
+
* the `srcDir` is used to recursively find Qwik files.
|
|
350
|
+
*
|
|
351
|
+
* Default `src`
|
|
352
|
+
*/
|
|
353
|
+
srcDir?: string;
|
|
354
|
+
/**
|
|
355
|
+
* Alternative to `srcDir`, where `srcInputs` is able to provide the files manually. This option
|
|
356
|
+
* is useful for an environment without a file system, such as a webworker.
|
|
357
|
+
*
|
|
358
|
+
* Default: `null`
|
|
359
|
+
*/
|
|
360
|
+
srcInputs?: TransformModuleInput[] | null;
|
|
361
|
+
/**
|
|
362
|
+
* The root of the application, which is commonly the same directory as `package.json` and
|
|
363
|
+
* `rollup.config.js`.
|
|
364
|
+
*
|
|
365
|
+
* Default `process.cwd()`
|
|
366
|
+
*/
|
|
367
|
+
rootDir?: string;
|
|
368
|
+
/**
|
|
369
|
+
* The client build will create a manifest and this hook is called with the generated build data.
|
|
370
|
+
*
|
|
371
|
+
* Default `undefined`
|
|
372
|
+
*/
|
|
373
|
+
manifestOutput?: (manifest: QwikManifest) => Promise<void> | void;
|
|
374
|
+
/**
|
|
375
|
+
* The SSR build requires the manifest generated during the client build. The `manifestInput`
|
|
376
|
+
* option can be used to manually provide a manifest.
|
|
377
|
+
*
|
|
378
|
+
* Default `undefined`
|
|
379
|
+
*/
|
|
380
|
+
manifestInput?: QwikManifest;
|
|
381
|
+
optimizerOptions?: OptimizerOptions;
|
|
382
|
+
/**
|
|
383
|
+
* Hook that's called after the build and provides all of the transformed modules that were used
|
|
384
|
+
* before bundling.
|
|
385
|
+
*/
|
|
386
|
+
transformedModuleOutput?: ((transformedModules: TransformModule[]) => Promise<void> | void) | null;
|
|
387
|
+
/**
|
|
388
|
+
* Run eslint on the source files for the ssr build or dev server. This can slow down startup on
|
|
389
|
+
* large projects. Defaults to `true`
|
|
390
|
+
*/
|
|
391
|
+
lint?: boolean;
|
|
392
|
+
/**
|
|
393
|
+
* Experimental features. These can come and go in patch releases, and their API is not guaranteed
|
|
394
|
+
* to be stable between releases.
|
|
395
|
+
*/
|
|
396
|
+
experimental?: (keyof typeof ExperimentalFeatures)[];
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/** @public */
|
|
400
|
+
export declare interface QwikSymbol {
|
|
401
|
+
origin: string;
|
|
402
|
+
displayName: string;
|
|
403
|
+
hash: string;
|
|
404
|
+
canonicalFilename: string;
|
|
405
|
+
ctxKind: 'function' | 'eventHandler';
|
|
406
|
+
ctxName: string;
|
|
407
|
+
/** Whether the symbol captures a variable */
|
|
408
|
+
captures: boolean;
|
|
409
|
+
parent: string | null;
|
|
410
|
+
loc: [number, number];
|
|
411
|
+
/** The parameter names if it's a function with parameters */
|
|
412
|
+
paramNames?: string[];
|
|
413
|
+
/** The transformed names of scoped variables, if any */
|
|
414
|
+
captureNames?: string[];
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* The types for Vite/Rollup don't allow us to be too specific about the return type. The correct
|
|
419
|
+
* return type is `[QwikVitePlugin, VitePlugin<never>]`, and if you search the plugin by name you'll
|
|
420
|
+
* get the `QwikVitePlugin`.
|
|
421
|
+
*
|
|
422
|
+
* @public
|
|
423
|
+
*/
|
|
424
|
+
export declare function qwikVite(qwikViteOpts?: QwikVitePluginOptions): any;
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* This is the type of the "pre" Qwik Vite plugin. `qwikVite` actually returns a tuple of two
|
|
428
|
+
* plugins, but after Vite flattens them, you can find the plugin by name.
|
|
429
|
+
*
|
|
430
|
+
* @public
|
|
431
|
+
*/
|
|
432
|
+
export declare type QwikVitePlugin = P<QwikVitePluginApi> & {
|
|
433
|
+
name: 'vite-plugin-qwik';
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
/** @public */
|
|
437
|
+
export declare interface QwikVitePluginApi {
|
|
438
|
+
getOptimizer: () => Optimizer | null;
|
|
439
|
+
getOptions: () => NormalizedQwikPluginOptions;
|
|
440
|
+
getManifest: () => QwikManifest | null;
|
|
441
|
+
getRootDir: () => string | null;
|
|
442
|
+
getClientOutDir: () => string | null;
|
|
443
|
+
getClientPublicOutDir: () => string | null;
|
|
444
|
+
getAssetsDir: () => string | undefined;
|
|
445
|
+
registerBundleGraphAdder: (adder: BundleGraphAdder) => void;
|
|
446
|
+
/** @internal */
|
|
447
|
+
_oldDevSsrServer: () => boolean | undefined;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
declare interface QwikVitePluginCommonOptions {
|
|
451
|
+
/**
|
|
452
|
+
* Prints verbose Qwik plugin debug logs.
|
|
453
|
+
*
|
|
454
|
+
* Default `false`
|
|
455
|
+
*/
|
|
456
|
+
debug?: boolean;
|
|
457
|
+
/**
|
|
458
|
+
* The Qwik entry strategy to use while building for production. During development the type is
|
|
459
|
+
* always `segment`.
|
|
460
|
+
*
|
|
461
|
+
* Default `{ type: "smart" }`)
|
|
462
|
+
*/
|
|
463
|
+
entryStrategy?: EntryStrategy;
|
|
464
|
+
/**
|
|
465
|
+
* The source directory to find all the Qwik components. Since Qwik does not have a single input,
|
|
466
|
+
* the `srcDir` is used to recursively find Qwik files.
|
|
467
|
+
*
|
|
468
|
+
* Default `src`
|
|
469
|
+
*/
|
|
470
|
+
srcDir?: string;
|
|
471
|
+
/**
|
|
472
|
+
* List of tsconfig.json files to use for ESLint warnings during development.
|
|
473
|
+
*
|
|
474
|
+
* Default `['tsconfig.json']`
|
|
475
|
+
*/
|
|
476
|
+
tsconfigFileNames?: string[];
|
|
477
|
+
/**
|
|
478
|
+
* List of directories to recursively search for Qwik components or Vendors.
|
|
479
|
+
*
|
|
480
|
+
* Default `[]`
|
|
481
|
+
*
|
|
482
|
+
* @deprecated No longer used. Instead, any imported file with `.qwik.` in the name is processed.
|
|
483
|
+
*/
|
|
484
|
+
vendorRoots?: string[];
|
|
485
|
+
/**
|
|
486
|
+
* Disables the automatic vendor roots scan. This is useful when you want to manually specify the
|
|
487
|
+
* vendor roots.
|
|
488
|
+
*/
|
|
489
|
+
disableVendorScan?: boolean;
|
|
490
|
+
/**
|
|
491
|
+
* Options for the Qwik optimizer.
|
|
492
|
+
*
|
|
493
|
+
* Default `undefined`
|
|
494
|
+
*/
|
|
495
|
+
optimizerOptions?: OptimizerOptions;
|
|
496
|
+
/**
|
|
497
|
+
* Hook that's called after the build and provides all of the transformed modules that were used
|
|
498
|
+
* before bundling.
|
|
499
|
+
*/
|
|
500
|
+
transformedModuleOutput?: ((transformedModules: TransformModule[]) => Promise<void> | void) | null;
|
|
501
|
+
devTools?: {
|
|
502
|
+
/**
|
|
503
|
+
* Validates image sizes for CLS issues during development. In case of issues, provides you with
|
|
504
|
+
* a correct image size resolutions. If set to `false`, image dev tool will be disabled.
|
|
505
|
+
*
|
|
506
|
+
* Default `true`
|
|
507
|
+
*/
|
|
508
|
+
imageDevTools?: boolean | true;
|
|
509
|
+
/**
|
|
510
|
+
* Press-hold the defined keys to enable qwik dev inspector. By default the behavior is
|
|
511
|
+
* activated by pressing the left or right `Alt` key. If set to `false`, qwik dev inspector will
|
|
512
|
+
* be disabled.
|
|
513
|
+
*
|
|
514
|
+
* Valid values are `KeyboardEvent.code` values. Please note that the 'Left' and 'Right'
|
|
515
|
+
* suffixes are ignored.
|
|
516
|
+
*/
|
|
517
|
+
clickToSource?: string[] | false;
|
|
518
|
+
};
|
|
519
|
+
/**
|
|
520
|
+
* Predicate function to filter out files from the optimizer. hook for resolveId, load, and
|
|
521
|
+
* transform
|
|
522
|
+
*/
|
|
523
|
+
fileFilter?: (id: string, hook: string) => boolean;
|
|
524
|
+
/**
|
|
525
|
+
* Run eslint on the source files for the ssr build or dev server. This can slow down startup on
|
|
526
|
+
* large projects. Defaults to `true`
|
|
527
|
+
*/
|
|
528
|
+
lint?: boolean;
|
|
529
|
+
/**
|
|
530
|
+
* Experimental features. These can come and go in patch releases, and their API is not guaranteed
|
|
531
|
+
* to be stable between releases
|
|
532
|
+
*/
|
|
533
|
+
experimental?: (keyof typeof ExperimentalFeatures)[];
|
|
534
|
+
/**
|
|
535
|
+
* Disables automatic preloading of font assets (WOFF/WOFF2/TTF) found in the build output. When
|
|
536
|
+
* enabled, the plugin will not add `<link rel="preload">` tags for font files in the document
|
|
537
|
+
* head.
|
|
538
|
+
*
|
|
539
|
+
* Disabling may impact Cumulative Layout Shift (CLS) metrics.
|
|
540
|
+
*/
|
|
541
|
+
disableFontPreload?: boolean;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
declare interface QwikVitePluginCSROptions extends QwikVitePluginCommonOptions {
|
|
545
|
+
/** Client Side Rendering (CSR) mode. It will not support SSR, default to Vite's `index.html` file. */
|
|
546
|
+
csr: true;
|
|
547
|
+
client?: never;
|
|
548
|
+
devSsrServer?: never;
|
|
549
|
+
ssr?: never;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
declare interface QwikVitePluginCSROptions extends QwikVitePluginCommonOptions {
|
|
553
|
+
/** Client Side Rendering (CSR) mode. It will not support SSR, default to Vite's `index.html` file. */
|
|
554
|
+
csr: true;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
/** @public */
|
|
558
|
+
export declare type QwikVitePluginOptions = QwikVitePluginCSROptions | QwikVitePluginSSROptions;
|
|
559
|
+
|
|
560
|
+
declare interface QwikVitePluginSSROptions extends QwikVitePluginCommonOptions {
|
|
561
|
+
/** Client Side Rendering (CSR) mode. It will not support SSR, default to Vite's `index.html` file. */
|
|
562
|
+
csr?: false | undefined;
|
|
563
|
+
client?: {
|
|
564
|
+
/**
|
|
565
|
+
* The entry point for the client builds. This would be the application's root component
|
|
566
|
+
* typically.
|
|
567
|
+
*
|
|
568
|
+
* Default `src/components/app/app.tsx`
|
|
569
|
+
*/
|
|
570
|
+
input?: string[] | string;
|
|
571
|
+
/**
|
|
572
|
+
* Output directory for the client build.
|
|
573
|
+
*
|
|
574
|
+
* Default `dist`
|
|
575
|
+
*/
|
|
576
|
+
outDir?: string;
|
|
577
|
+
/**
|
|
578
|
+
* The client build will create a manifest and this hook is called with the generated build
|
|
579
|
+
* data.
|
|
580
|
+
*
|
|
581
|
+
* Default `undefined`
|
|
582
|
+
*/
|
|
583
|
+
manifestOutput?: (manifest: QwikManifest) => Promise<void> | void;
|
|
584
|
+
};
|
|
585
|
+
/** @deprecated Use the `devSsrServer` option of the qwikRouter() plugin instead. */
|
|
586
|
+
devSsrServer?: boolean;
|
|
587
|
+
/** Controls the SSR behavior. */
|
|
588
|
+
ssr?: {
|
|
589
|
+
/**
|
|
590
|
+
* The entry point for the SSR renderer. This file should export a `render()` function. This
|
|
591
|
+
* entry point and `render()` export function is also used for Vite's SSR development and
|
|
592
|
+
* Node.js debug mode.
|
|
593
|
+
*
|
|
594
|
+
* Default `src/entry.ssr.tsx`
|
|
595
|
+
*/
|
|
596
|
+
input?: string;
|
|
597
|
+
/**
|
|
598
|
+
* Output directory for the server build.
|
|
599
|
+
*
|
|
600
|
+
* Default `server`
|
|
601
|
+
*/
|
|
602
|
+
outDir?: string;
|
|
603
|
+
/**
|
|
604
|
+
* The SSR build requires the manifest generated during the client build. By default, this
|
|
605
|
+
* plugin will wire the client manifest to the ssr build. However, the `manifestInput` option
|
|
606
|
+
* can be used to manually provide a manifest.
|
|
607
|
+
*
|
|
608
|
+
* Default `undefined`
|
|
609
|
+
*/
|
|
610
|
+
manifestInput?: QwikManifest;
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
/** @public */
|
|
615
|
+
export declare interface ResolvedManifest {
|
|
616
|
+
mapper: SymbolMapper;
|
|
617
|
+
manifest: ServerQwikManifest;
|
|
618
|
+
injections?: GlobalInjections[];
|
|
619
|
+
bundleGraph?: QwikBundleGraph;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
/** @public */
|
|
623
|
+
declare interface SegmentAnalysis {
|
|
624
|
+
origin: string;
|
|
625
|
+
name: string;
|
|
626
|
+
entry: string | null;
|
|
627
|
+
displayName: string;
|
|
628
|
+
hash: string;
|
|
629
|
+
canonicalFilename: string;
|
|
630
|
+
extension: string;
|
|
631
|
+
parent: string | null;
|
|
632
|
+
ctxKind: 'eventHandler' | 'function';
|
|
633
|
+
ctxName: string;
|
|
634
|
+
captures: boolean;
|
|
635
|
+
loc: [number, number];
|
|
636
|
+
/** The parameter names if it's a function with parameters */
|
|
637
|
+
paramNames?: string[];
|
|
638
|
+
/** The transformed names of scoped variables, if any */
|
|
639
|
+
captureNames?: string[];
|
|
640
|
+
}
|
|
641
|
+
export { SegmentAnalysis as HookAnalysis }
|
|
642
|
+
export { SegmentAnalysis }
|
|
643
|
+
|
|
644
|
+
/** @public */
|
|
645
|
+
declare interface SegmentEntryStrategy {
|
|
646
|
+
type: 'segment';
|
|
647
|
+
manual?: Record<string, string>;
|
|
648
|
+
}
|
|
649
|
+
export { SegmentEntryStrategy as HookEntryStrategy }
|
|
650
|
+
export { SegmentEntryStrategy }
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* The manifest values that are needed for SSR.
|
|
654
|
+
*
|
|
655
|
+
* @public
|
|
656
|
+
*/
|
|
657
|
+
export declare type ServerQwikManifest = Pick<QwikManifest, 'manifestHash' | 'injections' | 'bundleGraph' | 'bundleGraphAsset' | 'mapping' | 'preloader' | 'core' | 'qwikLoader'>;
|
|
658
|
+
|
|
659
|
+
/** @public */
|
|
660
|
+
export declare interface SingleEntryStrategy {
|
|
661
|
+
type: 'single';
|
|
662
|
+
manual?: Record<string, string>;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
/** @public */
|
|
666
|
+
export declare interface SmartEntryStrategy {
|
|
667
|
+
type: 'smart';
|
|
668
|
+
manual?: Record<string, string>;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
/** @public */
|
|
672
|
+
export declare interface SourceLocation {
|
|
673
|
+
hi: number;
|
|
674
|
+
lo: number;
|
|
675
|
+
startLine: number;
|
|
676
|
+
startCol: number;
|
|
677
|
+
endLine: number;
|
|
678
|
+
endCol: number;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
/** @public */
|
|
682
|
+
export declare type SourceMapsOption = 'external' | 'inline' | undefined | null;
|
|
683
|
+
|
|
684
|
+
/** @public */
|
|
685
|
+
export declare type SymbolMapper = Record<string, readonly [symbol: string, chunk: string]>;
|
|
686
|
+
|
|
687
|
+
/** @alpha @deprecated No longer needed, it is automatic now */
|
|
688
|
+
export declare const symbolMapper: undefined;
|
|
689
|
+
|
|
690
|
+
/** @public */
|
|
691
|
+
export declare type SymbolMapperFn = (symbolName: string, mapper: SymbolMapper | undefined, parent?: string) => readonly [symbol: string, chunk: string] | undefined;
|
|
692
|
+
|
|
693
|
+
/** @public */
|
|
694
|
+
export declare type SystemEnvironment = 'node' | 'deno' | 'bun' | 'webworker' | 'browsermain' | 'unknown';
|
|
695
|
+
|
|
696
|
+
/** @public */
|
|
697
|
+
export declare interface TransformModule {
|
|
698
|
+
path: string;
|
|
699
|
+
isEntry: boolean;
|
|
700
|
+
code: string;
|
|
701
|
+
map: string | null;
|
|
702
|
+
segment: SegmentAnalysis | null;
|
|
703
|
+
origPath: string | null;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
/** @public */
|
|
707
|
+
export declare interface TransformModuleInput {
|
|
708
|
+
path: string;
|
|
709
|
+
devPath?: string;
|
|
710
|
+
code: string;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
/** @public */
|
|
714
|
+
export declare interface TransformModulesOptions extends TransformOptions {
|
|
715
|
+
input: TransformModuleInput[];
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
/** @public */
|
|
719
|
+
export declare interface TransformOptions {
|
|
720
|
+
srcDir: string;
|
|
721
|
+
rootDir?: string;
|
|
722
|
+
entryStrategy?: EntryStrategy;
|
|
723
|
+
minify?: MinifyMode;
|
|
724
|
+
sourceMaps?: boolean;
|
|
725
|
+
transpileTs?: boolean;
|
|
726
|
+
transpileJsx?: boolean;
|
|
727
|
+
preserveFilenames?: boolean;
|
|
728
|
+
explicitExtensions?: boolean;
|
|
729
|
+
mode?: EmitMode;
|
|
730
|
+
scope?: string;
|
|
731
|
+
stripExports?: string[];
|
|
732
|
+
regCtxName?: string[];
|
|
733
|
+
stripCtxName?: string[];
|
|
734
|
+
stripEventHandlers?: boolean;
|
|
735
|
+
isServer?: boolean;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
/** @public */
|
|
739
|
+
export declare interface TransformOutput {
|
|
740
|
+
modules: TransformModule[];
|
|
741
|
+
diagnostics: Diagnostic[];
|
|
742
|
+
isTypeScript: boolean;
|
|
743
|
+
isJsx: boolean;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
/** @public */
|
|
747
|
+
export declare type TranspileOption = boolean | undefined | null;
|
|
748
|
+
|
|
749
|
+
/** @public */
|
|
750
|
+
export declare const versions: {
|
|
751
|
+
qwik: string;
|
|
752
|
+
};
|
|
753
|
+
|
|
754
|
+
export { }
|