@@ -35,13 +35,14 @@ export const replResolver = (
35
35
return srcInputs . find ( ( i ) => i . path === id ) ?. path ;
36
36
} ;
37
37
38
- const getQwik = ( id : string , external ?: true ) => {
38
+ const resolveQwik = ( id : string , external ?: true ) => {
39
39
const path = deps [ QWIK_PKG_NAME_V1 ] [ id ] ;
40
40
if ( ! path ) {
41
41
throw new Error ( `Unknown Qwik path: ${ id } ` ) ;
42
42
}
43
43
return {
44
- id : `\0@qwik${ id } ` ,
44
+ // Make sure this matches the regexes in manifest.ts
45
+ id : `/node_modules/@qwik.dev/core${ id } ` ,
45
46
sideEffects : false ,
46
47
// It would be nice to load qwik as external, but
47
48
// we import core and core/build so we need processing
@@ -58,30 +59,30 @@ export const replResolver = (
58
59
if ( id . startsWith ( 'http' ) ) {
59
60
return { id, external : true } ;
60
61
}
61
- if ( id . startsWith ( '\0 @qwik/' ) ) {
62
+ if ( id . startsWith ( '/node_modules/ @qwik.dev/core /' ) ) {
62
63
return id ;
63
64
}
64
65
const match = id . match ( / ( @ b u i l d e r \. i o \/ q w i k | @ q w i k \. d e v \/ c o r e ) ( .* ) / ) ;
65
66
if ( match ) {
66
67
const pkgName = match [ 2 ] ;
67
68
68
69
if ( pkgName === '/build' ) {
69
- return `\0 @qwik/build` ;
70
+ return `/node_modules/ @qwik.dev/core /build` ;
70
71
}
71
72
if ( ! pkgName || pkgName === '/jsx-runtime' || pkgName === '/jsx-dev-runtime' ) {
72
- return getQwik ( '/dist/core.mjs' ) ;
73
+ return resolveQwik ( '/dist/core.mjs' ) ;
73
74
}
74
75
if ( pkgName === '/server' ) {
75
- return getQwik ( '/dist/server.mjs' ) ;
76
+ return resolveQwik ( '/dist/server.mjs' ) ;
76
77
}
77
78
if ( pkgName . includes ( '/preloader' ) ) {
78
- return getQwik ( '/dist/preloader.mjs' ) ;
79
+ return resolveQwik ( '/dist/preloader.mjs' ) ;
79
80
}
80
81
if ( pkgName . includes ( '/qwikloader' ) ) {
81
- return getQwik ( '/dist/qwikloader.js' ) ;
82
+ return resolveQwik ( '/dist/qwikloader.js' ) ;
82
83
}
83
84
if ( pkgName . includes ( '/handlers' ) ) {
84
- return getQwik ( '/handlers.mjs' ) ;
85
+ return resolveQwik ( '/handlers.mjs' ) ;
85
86
}
86
87
}
87
88
// Simple relative file resolution
@@ -107,8 +108,8 @@ export const replResolver = (
107
108
if ( input && typeof input . code === 'string' ) {
108
109
return input . code ;
109
110
}
110
- if ( id . startsWith ( '\0 @qwik/' ) ) {
111
- const path = id . slice ( '\0 @qwik' . length ) ;
111
+ if ( id . startsWith ( '/node_modules/ @qwik.dev/core /' ) ) {
112
+ const path = id . slice ( '/node_modules/ @qwik.dev/core ' . length ) ;
112
113
if ( path === '/build' ) {
113
114
// Virtual module for Qwik build
114
115
const isDev = options . buildMode === 'development' ;
0 commit comments