@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.
Files changed (132) 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/backpatch/index.cjs +6 -0
  9. package/dist/backpatch/index.d.ts +2 -0
  10. package/dist/backpatch/index.mjs +5 -0
  11. package/dist/{prefetch → backpatch}/package.json +2 -2
  12. package/dist/backpatch-executor.debug.js +34 -0
  13. package/dist/backpatch-executor.js +1 -0
  14. package/dist/build/index.cjs +3 -3
  15. package/dist/build/index.d.ts +22 -22
  16. package/dist/build/package.json +1 -1
  17. package/dist/cli.cjs +3035 -767
  18. package/dist/core-internal.d.ts +4622 -4153
  19. package/dist/core.cjs +7327 -6169
  20. package/dist/core.cjs.map +1 -1
  21. package/dist/core.min.mjs +1 -1
  22. package/dist/core.mjs +7294 -6163
  23. package/dist/core.mjs.map +1 -1
  24. package/dist/core.prod.cjs +3209 -2612
  25. package/dist/core.prod.mjs +3932 -3294
  26. package/dist/insights/index.qwik.cjs +1 -4142
  27. package/dist/insights/index.qwik.mjs +63 -4133
  28. package/dist/insights/vite/index.cjs +1 -82
  29. package/dist/insights/vite/index.mjs +65 -37
  30. package/dist/insights/vite.d.ts +22 -0
  31. package/dist/{insights/insights.d.ts → insights.d.ts} +33 -22
  32. package/dist/loader/index.cjs +2 -2
  33. package/dist/loader/index.mjs +2 -2
  34. package/dist/loader/package.json +1 -1
  35. package/dist/optimizer.cjs +201 -3817
  36. package/dist/optimizer.d.ts +754 -707
  37. package/dist/optimizer.mjs +2605 -3628
  38. package/dist/preloader.cjs +266 -0
  39. package/dist/preloader.mjs +195 -0
  40. package/dist/qwikloader.debug.js +228 -222
  41. package/dist/qwikloader.js +1 -3
  42. package/dist/server.cjs +915 -621
  43. package/dist/server.d.ts +519 -402
  44. package/dist/server.mjs +900 -615
  45. package/dist/starters/adapters/aws-lambda/adapters/aws-lambda/vite.config.mts +1 -1
  46. package/dist/starters/adapters/aws-lambda/package.json +1 -1
  47. package/dist/starters/adapters/aws-lambda/serverless.yml +15 -0
  48. package/dist/starters/adapters/aws-lambda/src/entry_aws-lambda.tsx +2 -8
  49. package/dist/starters/adapters/azure-swa/adapters/azure-swa/vite.config.mts +1 -1
  50. package/dist/starters/adapters/azure-swa/package.json +1 -1
  51. package/dist/starters/adapters/azure-swa/public/staticwebapp.config.json +7 -0
  52. package/dist/starters/adapters/azure-swa/src/entry.azure-swa.tsx +2 -4
  53. package/dist/starters/adapters/bun/adapters/bun/vite.config.mts +2 -2
  54. package/dist/starters/adapters/bun/package.json +1 -1
  55. package/dist/starters/adapters/bun/src/entry.bun.ts +3 -4
  56. package/dist/starters/adapters/cloud-run/adapters/cloud-run/vite.config.mts +1 -1
  57. package/dist/starters/adapters/cloud-run/package.json +1 -1
  58. package/dist/starters/adapters/cloud-run/src/entry.cloud-run.tsx +2 -6
  59. package/dist/starters/adapters/cloudflare-pages/adapters/cloudflare-pages/vite.config.mts +1 -1
  60. package/dist/starters/adapters/cloudflare-pages/package.json +1 -1
  61. package/dist/starters/adapters/cloudflare-pages/public/_headers +2 -0
  62. package/dist/starters/adapters/cloudflare-pages/src/entry.cloudflare-pages.tsx +2 -4
  63. package/dist/starters/adapters/deno/adapters/deno/vite.config.mts +1 -1
  64. package/dist/starters/adapters/deno/package.json +1 -1
  65. package/dist/starters/adapters/deno/src/entry.deno.ts +3 -4
  66. package/dist/starters/adapters/express/adapters/express/vite.config.mts +1 -1
  67. package/dist/starters/adapters/express/package.json +1 -1
  68. package/dist/starters/adapters/express/src/entry.express.tsx +6 -5
  69. package/dist/starters/adapters/fastify/adapters/fastify/vite.config.mts +1 -1
  70. package/dist/starters/adapters/fastify/package.json +1 -1
  71. package/dist/starters/adapters/fastify/src/entry.fastify.tsx +3 -2
  72. package/dist/starters/adapters/fastify/src/plugins/fastify-qwik.ts +10 -3
  73. package/dist/starters/adapters/firebase/adapters/firebase/vite.config.mts +1 -1
  74. package/dist/starters/adapters/firebase/firebase.json +12 -1
  75. package/dist/starters/adapters/firebase/functions/index.js +2 -3
  76. package/dist/starters/adapters/firebase/package.json +1 -1
  77. package/dist/starters/adapters/firebase/src/entry-firebase.tsx +2 -4
  78. package/dist/starters/adapters/netlify-edge/adapters/netlify-edge/vite.config.mts +1 -1
  79. package/dist/starters/adapters/netlify-edge/package.json +1 -1
  80. package/dist/starters/adapters/netlify-edge/public/_headers +2 -0
  81. package/dist/starters/adapters/netlify-edge/src/entry.netlify-edge.tsx +2 -4
  82. package/dist/starters/adapters/node-server/adapters/node-server/vite.config.mts +1 -1
  83. package/dist/starters/adapters/node-server/package.json +1 -1
  84. package/dist/starters/adapters/node-server/src/entry.node-server.tsx +3 -4
  85. package/dist/starters/adapters/ssg/README.md +9 -0
  86. package/dist/starters/adapters/{static/adapters/static → ssg/adapters/ssg}/vite.config.mts +2 -2
  87. package/dist/starters/adapters/ssg/package.json +19 -0
  88. package/dist/starters/adapters/vercel-edge/adapters/vercel-edge/vite.config.mts +1 -1
  89. package/dist/starters/adapters/vercel-edge/package.json +1 -1
  90. package/dist/starters/adapters/vercel-edge/src/entry.vercel-edge.tsx +2 -4
  91. package/dist/starters/adapters/vercel-edge/vercel.json +1 -1
  92. package/dist/starters/features/auth/package.json +1 -1
  93. package/dist/starters/features/bootstrap/src/routes/bootstrap/layout.tsx +0 -11
  94. package/dist/starters/features/csr/index.html +23 -0
  95. package/dist/starters/features/csr/package.json +29 -0
  96. package/dist/starters/features/csr/src/root.tsx +15 -0
  97. package/dist/starters/features/csr/vite.config.mts +13 -0
  98. package/dist/starters/features/localize/package.json +3 -3
  99. package/dist/starters/features/localize/src/entry.ssr.tsx +17 -23
  100. package/dist/starters/features/localize/src/routes/[locale]/i18n-utils.ts +1 -1
  101. package/dist/starters/features/pandacss/package.json +1 -1
  102. package/dist/starters/features/partytown/package.json +4 -4
  103. package/dist/starters/features/partytown/src/components/partytown/partytown.tsx +2 -2
  104. package/dist/starters/features/playwright/playwright-report/index.html +953 -911
  105. package/dist/starters/features/postcss/postcss.config.js +2 -2
  106. package/dist/starters/features/service-worker/package.json +13 -0
  107. package/dist/starters/features/service-worker/src/routes/service-worker.ts +14 -0
  108. package/dist/starters/features/styled-vanilla-extract/package.json +2 -1
  109. package/dist/starters/features/tailwind/package.json +4 -3
  110. package/dist/starters/features/tailwind/prettier.config.js +10 -0
  111. package/dist/starters/features/tailwind/src/global.css +1 -1
  112. package/dist/starters/features/tailwind-v3/package.json +1 -1
  113. package/dist/starters/features/tailwind-v3/prettier.config.js +10 -0
  114. package/dist/starters/features/tailwind-v3/tailwind.config.js +2 -2
  115. package/dist/testing/index.cjs +14313 -11732
  116. package/dist/testing/index.d.ts +1112 -141
  117. package/dist/testing/index.mjs +14225 -11661
  118. package/dist/testing/package.json +1 -1
  119. package/package.json +28 -14
  120. package/public.d.ts +5 -0
  121. package/server.d.ts +1 -0
  122. package/dist/insights/index.d.ts +0 -1
  123. package/dist/insights/vite/index.d.ts +0 -1
  124. package/dist/insights/vite/insights-plugin.d.ts +0 -10
  125. package/dist/prefetch/index.cjs +0 -4
  126. package/dist/prefetch/index.d.ts +0 -2
  127. package/dist/prefetch/index.mjs +0 -3
  128. package/dist/qwik-prefetch.debug.js +0 -244
  129. package/dist/qwik-prefetch.js +0 -1
  130. package/dist/starters/adapters/static/README.md +0 -5
  131. package/dist/starters/adapters/static/package.json +0 -19
  132. package/dist/starters/features/tailwind/.prettierrc.js +0 -3
@@ -1,707 +1,754 @@
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
+ /** @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 { }