@@ -55,13 +55,8 @@ const virtualModuleId = 'tutorialkit:override-components';
55
55
const resolvedId = `\0${ virtualModuleId } ` ;
56
56
57
57
export function overrideComponents ( { components, defaultRoutes } : Options ) : VitePlugin {
58
- let root = '' ;
59
-
60
58
return {
61
59
name : 'tutorialkit-override-components-plugin' ,
62
- configResolved ( resolvedConfig ) {
63
- root = resolvedConfig . root ;
64
- } ,
65
60
resolveId ( id ) {
66
61
if ( id === virtualModuleId ) {
67
62
return resolvedId ;
@@ -71,7 +66,10 @@ export function overrideComponents({ components, defaultRoutes }: Options): Vite
71
66
} ,
72
67
async load ( id ) {
73
68
if ( id === resolvedId ) {
74
- const topBar = components ?. TopBar || resolveDefaultTopBar ( defaultRoutes , root ) ;
69
+ const topBar = components ?. TopBar || resolveDefaultTopBar ( defaultRoutes ) ;
70
+
71
+ // TODO Remove, debug windows CI
72
+ console . log ( { topBar, defaultRoutes } ) ;
75
73
76
74
return `
77
75
export { default as TopBar } from '${ topBar } ';
@@ -83,11 +81,11 @@ export function overrideComponents({ components, defaultRoutes }: Options): Vite
83
81
} ;
84
82
}
85
83
86
- function resolveDefaultTopBar ( defaultRoutes : boolean , root : string ) {
84
+ function resolveDefaultTopBar ( defaultRoutes : boolean ) {
87
85
if ( defaultRoutes ) {
88
86
return '@tutorialkit/astro/default/components/TopBar.astro' ;
89
87
}
90
88
91
89
// default `TopBar` is used from local file when `defaultRoutes` is disabled
92
- return path . resolve ( root , ' src/components/TopBar.astro') ;
90
+ return './ src/components/TopBar.astro';
93
91
}
0 commit comments