-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
vite.ts
753 lines (661 loc) · 23.4 KB
/
vite.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
import type { Plugin as VitePlugin, UserConfig, ViteDevServer } from 'vite';
import type {
EntryStrategy,
GlobalInjections,
OptimizerOptions,
OptimizerSystem,
QwikManifest,
TransformModule,
} from '../types';
import type { Render, RenderOptions } from '../../../server';
import {
createPlugin,
NormalizedQwikPluginOptions,
parseId,
QwikBuildMode,
QwikPluginOptions,
QwikBuildTarget,
QWIK_CORE_ID,
Q_MANIFEST_FILENAME,
QWIK_CLIENT_MANIFEST_ID,
QWIK_BUILD_ID,
QwikPackages,
QWIK_JSX_RUNTIME_ID,
} from './plugin';
import { createRollupError, normalizeRollupOutputOptions } from './rollup';
import { QWIK_LOADER_DEFAULT_DEBUG, QWIK_LOADER_DEFAULT_MINIFIED } from '../scripts';
import { versions } from '../versions';
import type { RenderDocumentUserContext } from '../../../server/types';
const DEDUPE = [QWIK_CORE_ID, QWIK_JSX_RUNTIME_ID];
/**
* @alpha
*/
export function qwikVite(qwikViteOpts: QwikVitePluginOptions = {}): any {
let isClientDevOnly = false;
let clientDevInput: undefined | string = undefined;
let tmpClientManifestPath: undefined | string = undefined;
let viteCommand: 'build' | 'serve' = 'serve';
const injections: GlobalInjections[] = [];
const qwikPlugin = createPlugin(qwikViteOpts.optimizerOptions);
const vitePlugin: VitePlugin = {
name: 'vite-plugin-qwik',
enforce: 'pre',
api: {
getOptimizer: () => qwikPlugin.getOptimizer(),
getOptions: () => qwikPlugin.getOptions(),
},
async config(viteConfig, viteEnv) {
await qwikPlugin.init();
const sys = qwikPlugin.getSys();
const path = qwikPlugin.getPath();
qwikPlugin.log(`vite config(), command: ${viteEnv.command}, env.mode: ${viteEnv.mode}`);
isClientDevOnly = viteEnv.command === 'serve' && viteEnv.mode !== 'ssr';
viteCommand = viteEnv.command;
let target: QwikBuildTarget;
if (viteConfig.build?.ssr || viteEnv.mode === 'ssr') {
target = 'ssr';
} else if (viteEnv.mode === 'lib') {
target = 'lib';
} else {
target = 'client';
}
let buildMode: QwikBuildMode;
if (viteEnv.mode === 'production') {
buildMode = 'production';
} else if (viteEnv.mode === 'development') {
buildMode = 'development';
} else if (viteEnv.command === 'build' && target === 'client') {
// build (production)
buildMode = 'production';
} else {
// serve (development)
buildMode = 'development';
}
let forceFullBuild = true;
if (viteEnv.command === 'serve') {
qwikViteOpts.entryStrategy = { type: 'hook' };
forceFullBuild = false;
} else {
forceFullBuild = true;
}
const shouldFindVendors = target === 'client' || viteCommand === 'serve';
const vendorRoots = shouldFindVendors
? await findQwikRoots(sys, path.join(sys.cwd(), 'package.json'))
: [];
const pluginOpts: QwikPluginOptions = {
target,
buildMode,
debug: qwikViteOpts.debug,
entryStrategy: qwikViteOpts.entryStrategy,
rootDir: viteConfig.root,
resolveQwikBuild: viteEnv.command === 'build',
transformedModuleOutput: qwikViteOpts.transformedModuleOutput,
forceFullBuild,
vendorRoots: vendorRoots.map((v) => v.path),
};
if (viteEnv.command === 'serve') {
qwikViteOpts.entryStrategy = { type: 'hook' };
}
if (target === 'ssr') {
// ssr
if (typeof viteConfig.build?.ssr === 'string') {
// from --ssr flag user config
// entry.server.tsx (express/cloudflare/netlify)
pluginOpts.input = viteConfig.build.ssr;
} else {
// entry.ssr.tsx input (exports render())
pluginOpts.input = qwikViteOpts.ssr?.input;
}
pluginOpts.outDir = qwikViteOpts.ssr?.outDir;
pluginOpts.manifestInput = qwikViteOpts.ssr?.manifestInput;
} else if (target === 'client') {
// client
pluginOpts.input = qwikViteOpts.client?.input;
pluginOpts.outDir = qwikViteOpts.client?.outDir;
pluginOpts.manifestOutput = qwikViteOpts.client?.manifestOutput;
} else {
if (typeof viteConfig.build?.lib === 'object') {
pluginOpts.input = viteConfig.build?.lib.entry;
}
pluginOpts.outDir = viteConfig.build?.outDir;
}
if (sys.env === 'node') {
const fs: typeof import('fs') = await sys.dynamicImport('fs');
try {
const rootDir = pluginOpts.rootDir ?? sys.cwd();
const packageJsonPath = sys.path.join(rootDir, 'package.json');
const pkgString = await fs.promises.readFile(packageJsonPath, 'utf-8');
try {
const data = JSON.parse(pkgString);
if (typeof data.name === 'string') {
pluginOpts.scope = data.name;
}
} catch (e) {
console.error(e);
}
} catch (e) {
// error reading package.json from nodejs fs, ok to ignore
}
// In a NodeJs environment, create a path to a q-manifest.json file within the
// OS tmp directory. This path should always be the same for both client and ssr.
// Client build will write to this path, and SSR will read from it. For this reason,
// the Client build should always start and finish before the SSR build.
const nodeOs: typeof import('os') = await sys.dynamicImport('os');
tmpClientManifestPath = path.join(nodeOs.tmpdir(), `vite-plugin-qwik-q-manifest.json`);
if (target === 'ssr' && !pluginOpts.manifestInput) {
// This is a SSR build so we should load the client build's manifest
// so it can be used as the manifestInput of the SSR build
try {
const clientManifestStr = await fs.promises.readFile(tmpClientManifestPath, 'utf-8');
pluginOpts.manifestInput = JSON.parse(clientManifestStr);
} catch (e) {
/**/
}
}
}
const opts = qwikPlugin.normalizeOptions(pluginOpts);
if (typeof qwikViteOpts.client?.devInput === 'string') {
clientDevInput = path.resolve(opts.rootDir, qwikViteOpts.client.devInput);
} else {
if (opts.srcDir) {
clientDevInput = path.resolve(opts.srcDir, CLIENT_DEV_INPUT);
} else {
clientDevInput = path.resolve(opts.rootDir, 'src', CLIENT_DEV_INPUT);
}
}
clientDevInput = qwikPlugin.normalizePath(clientDevInput);
const vendorIds = vendorRoots.map((v) => v.id);
const updatedViteConfig: UserConfig = {
resolve: {
dedupe: [...DEDUPE, ...vendorIds],
conditions: [],
},
optimizeDeps: {
exclude: [
'@vite/client',
'@vite/env',
QWIK_CORE_ID,
QWIK_JSX_RUNTIME_ID,
QWIK_BUILD_ID,
QWIK_CLIENT_MANIFEST_ID,
...vendorIds,
],
},
build: {
outDir: opts.outDir,
rollupOptions: {
input: opts.input,
preserveEntrySignatures: 'exports-only',
output: normalizeRollupOutputOptions(path, opts, {}),
treeshake: {
moduleSideEffects: false,
},
onwarn: (warning, warn) => {
if (
warning.plugin === 'typescript' &&
warning.message.includes('outputToFilesystem')
) {
return;
}
warn(warning);
},
},
polyfillModulePreload: false,
dynamicImportVarsOptions: {
exclude: [/./],
},
},
};
if (opts.target === 'ssr') {
// SSR Build
updatedViteConfig.build!.ssr = true;
if (viteCommand === 'serve') {
(updatedViteConfig as any).ssr = {
noExternal: vendorIds,
} as any;
} else {
updatedViteConfig.publicDir = false;
}
} else if (opts.target === 'client') {
if (buildMode === 'production') {
updatedViteConfig.resolve!.conditions = ['min'];
}
// Client Build
if (isClientDevOnly) {
updatedViteConfig.build!.rollupOptions!.input = clientDevInput;
}
}
return updatedViteConfig;
},
async buildStart() {
await qwikPlugin.validateSource();
qwikPlugin.onAddWatchFile((ctx, path) => {
ctx.addWatchFile(path);
});
qwikPlugin.onDiagnostics((diagnostics, optimizer) => {
diagnostics.forEach((d) => {
if (d.category === 'error') {
this.error(createRollupError(optimizer, d));
} else {
this.warn(createRollupError(optimizer, d));
}
});
});
await qwikPlugin.buildStart(this);
},
resolveId(id, importer, resolveIdOpts) {
if (id.startsWith('\0')) {
return null;
}
if (isClientDevOnly && id === VITE_CLIENT_MODULE) {
return id;
}
return qwikPlugin.resolveId(this, id, importer, resolveIdOpts);
},
load(id, loadOpts) {
if (id.startsWith('\0')) {
return null;
}
id = qwikPlugin.normalizePath(id);
const opts = qwikPlugin.getOptions();
if (isClientDevOnly && id === VITE_CLIENT_MODULE) {
return getViteDevModule(opts);
}
if (viteCommand === 'serve' && id.endsWith(QWIK_CLIENT_MANIFEST_ID)) {
return {
code: 'export const manifest = undefined;',
};
}
return qwikPlugin.load(this, id, loadOpts);
},
transform(code, id) {
if (id.startsWith('\0')) {
return null;
}
if (isClientDevOnly) {
const parsedId = parseId(id);
if (parsedId.params.has(VITE_DEV_CLIENT_QS)) {
code = updateEntryDev(code);
}
}
return qwikPlugin.transform(this, code, id);
},
async generateBundle(_, rollupBundle) {
const opts = qwikPlugin.getOptions();
if (opts.target === 'client') {
// client build
const outputAnalyzer = qwikPlugin.createOutputAnalyzer();
for (const fileName in rollupBundle) {
const b = rollupBundle[fileName];
if (b.type === 'chunk') {
outputAnalyzer.addBundle({
fileName,
modules: b.modules,
imports: b.imports,
dynamicImports: b.dynamicImports,
size: b.code.length,
});
} else {
if (fileName.endsWith('.css')) {
injections.push({
tag: 'link',
location: 'head',
attributes: {
rel: 'stylesheet',
href: `/${fileName}`,
},
});
}
}
}
for (const i of injections) {
outputAnalyzer.addInjection(i);
}
const optimizer = qwikPlugin.getOptimizer();
const manifest = await outputAnalyzer.generateManifest();
manifest.platform = {
...versions,
vite: '',
rollup: this.meta?.rollupVersion || '',
env: optimizer.sys.env,
os: optimizer.sys.os,
};
if (optimizer.sys.env === 'node') {
manifest.platform.node = process.versions.node;
}
const clientManifestStr = JSON.stringify(manifest, null, 2);
this.emitFile({
type: 'asset',
fileName: Q_MANIFEST_FILENAME,
source: clientManifestStr,
});
if (typeof opts.manifestOutput === 'function') {
await opts.manifestOutput(manifest);
}
if (typeof opts.transformedModuleOutput === 'function') {
await opts.transformedModuleOutput(qwikPlugin.getTransformedOutputs());
}
const sys = qwikPlugin.getSys();
if (tmpClientManifestPath && sys.env === 'node') {
// Client build should write the manifest to a tmp dir
const fs: typeof import('fs') = await sys.dynamicImport('fs');
await fs.promises.writeFile(tmpClientManifestPath, clientManifestStr);
}
}
},
async configureServer(server: ViteDevServer) {
const opts = qwikPlugin.getOptions();
const sys = qwikPlugin.getSys();
const path = qwikPlugin.getPath();
qwikPlugin.log(`configureServer(), entry module: ${clientDevInput}`);
if (typeof fetch !== 'function' && sys.env === 'node') {
// polyfill fetch() when not available in NodeJS
qwikPlugin.log(`configureServer(), patch fetch()`);
const nodeFetch = await sys.dynamicImport('node-fetch');
global.fetch = nodeFetch;
global.Headers = nodeFetch.Headers;
global.Request = nodeFetch.Request;
global.Response = nodeFetch.Response;
}
server.middlewares.use(async (req, res, next) => {
const domain = 'http://' + (req.headers.host ?? 'localhost');
const url = new URL(req.originalUrl!, domain);
const pathname = url.pathname;
const hasExtension = /\.[\w?=&]+$/.test(pathname);
const isViteMod = pathname.startsWith('/@') || url.href.includes('?html-proxy');
const isVitePing = url.href.includes('__vite_ping');
const skipSSR = url.href.includes('ssr=false');
if (hasExtension || isViteMod || isVitePing || skipSSR) {
next();
return;
}
try {
if (req.headers.accept && req.headers.accept.includes('text/html')) {
const userContext: Record<string, any> = {
...(res as QwikViteDevResponse)._qwikUserCtx,
};
const status = typeof res.statusCode === 'number' ? res.statusCode : 200;
if (isClientDevOnly) {
qwikPlugin.log(`handleClientEntry("${url}")`);
const relPath = path.relative(opts.rootDir, clientDevInput!);
const entryUrl = '/' + qwikPlugin.normalizePath(relPath);
let html = getViteDevIndexHtml(entryUrl, userContext);
html = await server.transformIndexHtml(pathname, html);
res.setHeader('Content-Type', 'text/html; charset=utf-8');
res.setHeader('Cache-Control', 'no-cache, no-store, max-age=0');
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('X-Powered-By', 'Qwik Vite Dev Server');
res.writeHead(status);
res.end(html);
return;
}
qwikPlugin.log(`handleSSR("${url}"), ssr input: ${opts.input[0]}`);
const ssrModule = await server.ssrLoadModule(opts.input[0], {
fixStacktrace: true,
});
const render: Render = ssrModule.render;
if (typeof render === 'function') {
const manifest: QwikManifest = {
symbols: {},
mapping: {},
bundles: {},
injections: [],
version: '1',
};
Array.from(server.moduleGraph.fileToModulesMap.entries()).forEach((entry) => {
entry[1].forEach((v) => {
const hook = v.info?.meta?.hook;
let url = v.url;
if (v.lastHMRTimestamp) {
url += `?t=${v.lastHMRTimestamp}`;
}
if (hook) {
manifest.mapping[hook.name] = url;
}
const { pathId, query } = parseId(v.url);
if (query === '' && pathId.endsWith('.css')) {
manifest.injections!.push({
tag: 'link',
location: 'head',
attributes: {
rel: 'stylesheet',
href: url,
},
});
}
});
});
qwikPlugin.log(`handleSSR()`, 'symbols', manifest);
const renderToStringOpts: RenderOptions = {
url: url.href,
debug: true,
snapshot: !isClientDevOnly,
manifest: isClientDevOnly ? undefined : manifest,
symbolMapper: isClientDevOnly
? undefined
: (symbolName, mapper) => {
if (mapper) {
const hash = getSymbolHash(symbolName);
return mapper[hash];
}
},
prefetchStrategy: null,
userContext,
};
const result = await render(renderToStringOpts);
const html = await server.transformIndexHtml(pathname, result.html, req.originalUrl);
res.setHeader('Content-Type', 'text/html; charset=utf-8');
res.setHeader('Cache-Control', 'no-cache, no-store, max-age=0');
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('X-Powered-By', 'Qwik Vite Dev Server');
res.writeHead(status);
res.end(html);
} else {
next();
}
} else {
next();
}
} catch (e: any) {
next(e);
}
});
},
handleHotUpdate(ctx) {
qwikPlugin.log('handleHotUpdate()', ctx);
if (ctx.file.endsWith('.css')) {
qwikPlugin.log('handleHotUpdate()', 'force css reload');
ctx.server.ws.send({
type: 'full-reload',
});
return [];
}
},
};
return vitePlugin;
}
function getViteDevIndexHtml(entryUrl: string, userContext: Record<string, any>) {
const doc: RenderDocumentUserContext = {
_qwikUserCtx: userContext,
};
return `<!-- Qwik Vite Dev Mode -->
<!DOCTYPE html>
<html>
<head>
<script>
Object.assign(document, ${JSON.stringify(doc, null, 2)});
</script>
</head>
<body>
<script type="module" src="${entryUrl}?${VITE_DEV_CLIENT_QS}="></script>
</body>
</html>`;
}
function updateEntryDev(code: string) {
code = code.replace(/("|')@builder.io\/qwik("|')/g, `'${VITE_CLIENT_MODULE}'`);
return code;
}
function getViteDevModule(opts: NormalizedQwikPluginOptions) {
const qwikLoader = JSON.stringify(
opts.debug ? QWIK_LOADER_DEFAULT_DEBUG : QWIK_LOADER_DEFAULT_MINIFIED
);
return `// Qwik Vite Dev Module
import { render as qwikRender } from '@builder.io/qwik';
export function render(document, rootNode) {
const headNodes = [];
document.head.childNodes.forEach(n => headNodes.push(n));
document.head.textContent = '';
qwikRender(document, rootNode);
headNodes.forEach(n => document.head.appendChild(n));
let qwikLoader = document.getElementById('qwikloader');
if (!qwikLoader) {
qwikLoader = document.createElement('script');
qwikLoader.id = 'qwikloader';
qwikLoader.innerHTML = ${qwikLoader};
document.head.appendChild(qwikLoader);
}
if (!window.__qwikViteLog) {
window.__qwikViteLog = true;
console.debug("%c⭐️ Qwik Dev Mode","background: #0c75d2; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;","Do not use this mode in production!\\n - No portion of the application is pre-rendered on the server\\n - All of the application is running eagerly in the browser\\n - Optimizer/Serialization/Deserialization code is not exercised!");
}
}`;
}
const getSymbolHash = (symbolName: string) => {
const index = symbolName.lastIndexOf('_');
if (index > -1) {
return symbolName.slice(index + 1);
}
return symbolName;
};
const findQwikRoots = async (
sys: OptimizerSystem,
packageJsonPath: string
): Promise<QwikPackages[]> => {
if (sys.env === 'node') {
const fs: typeof import('fs') = await sys.dynamicImport('fs');
const { resolvePackageData }: typeof import('vite') = await sys.dynamicImport('vite');
try {
const data = await fs.promises.readFile(packageJsonPath, { encoding: 'utf-8' });
try {
const packageJson = JSON.parse(data);
const dependencies = packageJson['dependencies'];
const devDependencies = packageJson['devDependencies'];
const packages: string[] = [];
if (typeof dependencies === 'object') {
packages.push(...Object.keys(dependencies));
}
if (typeof devDependencies === 'object') {
packages.push(...Object.keys(devDependencies));
}
const basedir = sys.cwd();
const qwikDirs = packages
.map((id) => {
const pkgData = resolvePackageData(id, basedir);
if (pkgData) {
const qwikPath = pkgData.data['qwik'];
if (qwikPath) {
return {
id,
path: sys.path.resolve(pkgData.dir, qwikPath),
};
}
}
})
.filter(isNotNullable);
return qwikDirs;
} catch (e) {
console.error(e);
}
} catch (e) {
// ignore errors if root package.json not found
}
}
return [];
};
export const isNotNullable = <T>(v: T): v is NonNullable<T> => {
return v != null;
};
const VITE_CLIENT_MODULE = `@builder.io/qwik/vite-client`;
const VITE_DEV_CLIENT_QS = `qwik-vite-dev-client`;
const CLIENT_DEV_INPUT = 'entry.dev.tsx';
/**
* @alpha
*/
export interface QwikVitePluginOptions {
/**
* Prints verbose Qwik plugin debug logs.
* Default `false`
*/
debug?: boolean;
/**
* The Qwik entry strategy to use while bunding for production.
* During development the type is always `hook`.
* Default `{ type: "smart" }`)
*/
entryStrategy?: EntryStrategy;
/**
* The source directory to find all the Qwik components. Since Qwik
* does not have a single input, the `srcDir` is use to recursively
* find Qwik files.
* Default `src`
*/
srcDir?: string;
client?: {
/**
* The entry point for the client builds. Typically this would be
* the application's main component.
* Default `src/components/app/app.tsx`
*/
input?: string[] | string;
/**
* Entry input for client-side only development with hot-module reloading.
* This is for Vite development only and does not use SSR.
* Default `src/entry.dev.tsx`
*/
devInput?: string;
/**
* Output directory for the client build.
* Default `dist`
*/
outDir?: string;
/**
* The client build will create a manifest and this hook
* is called with the generated build data.
* Default `undefined`
*/
manifestOutput?: (manifest: QwikManifest) => Promise<void> | void;
};
ssr?: {
/**
* The entry point for the SSR renderer. This file should export
* a `render()` function. This entry point and `render()` export
* function is also used for Vite's SSR development and Nodejs
* debug mode.
* Default `src/entry.ssr.tsx`
*/
input?: string;
/**
* Output directory for the server build.
* Default `dist`
*/
outDir?: string;
/**
* The SSR build requires the manifest generated during the client build.
* By default, this plugin will wire the client manifest to the ssr build.
* However, the `manifestInput` option can be used to manually provide a manifest.
* Default `undefined`
*/
manifestInput?: QwikManifest;
};
optimizerOptions?: OptimizerOptions;
/**
* Hook that's called after the build and provides all of the transformed
* modules that were used before bundling.
*/
transformedModuleOutput?:
| ((transformedModules: TransformModule[]) => Promise<void> | void)
| null;
}
export interface QwikViteDevResponse {
_qwikUserCtx?: Record<string, any>;
}