@qwik.dev/core 2.0.0-alpha.9 → 2.0.0-beta.2

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