File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
qwik-router/src/buildtime/vite
qwik/src/optimizer/src/plugins Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -215,7 +215,9 @@ function qwikRouterPlugin(userOpts?: QwikRouterVitePluginOptions): any {
215
215
} ,
216
216
217
217
async transform ( code , id ) {
218
- if ( id . startsWith ( '\0' ) ) {
218
+ const isVirtualId = id . startsWith ( '\0' ) ;
219
+
220
+ if ( isVirtualId ) {
219
221
return ;
220
222
}
221
223
const ext = extname ( id ) . toLowerCase ( ) ;
Original file line number Diff line number Diff line change @@ -410,27 +410,29 @@ export function qwikVite(qwikViteOpts: QwikVitePluginOptions = {}): any {
410
410
411
411
resolveId ( id , importer , resolveIdOpts ) {
412
412
const shouldResolveFile = fileFilter ( id , 'resolveId' ) ;
413
+ const isDevClientModule = isClientDevOnly && id === VITE_CLIENT_MODULE ;
413
414
414
415
if ( isVirtualId ( id ) || ! shouldResolveFile ) {
415
416
return null ;
416
417
}
417
- if ( isClientDevOnly && id === VITE_CLIENT_MODULE ) {
418
+ if ( isDevClientModule ) {
418
419
return id ;
419
420
}
420
421
return qwikPlugin . resolveId ( this , id , importer , resolveIdOpts ) ;
421
422
} ,
422
423
423
424
load ( id , loadOpts ) {
424
425
const shouldLoadFile = fileFilter ( id , 'load' ) ;
426
+ const isDevClientModule = isClientDevOnly && id === VITE_CLIENT_MODULE ;
425
427
426
428
if ( isVirtualId ( id ) || ! shouldLoadFile ) {
427
429
return null ;
428
430
}
429
431
430
432
id = qwikPlugin . normalizePath ( id ) ;
431
- const opts = qwikPlugin . getOptions ( ) ;
432
433
433
- if ( isClientDevOnly && id === VITE_CLIENT_MODULE ) {
434
+ if ( isDevClientModule ) {
435
+ const opts = qwikPlugin . getOptions ( ) ;
434
436
return getViteDevModule ( opts ) ;
435
437
}
436
438
if ( viteCommand === 'serve' && id . endsWith ( QWIK_CLIENT_MANIFEST_ID ) ) {
You can’t perform that action at this time.
0 commit comments