@@ -51,13 +51,13 @@ pri.project.onAnalyseProject(files => {
5151 return true ;
5252 } )
5353 . map ( file => {
54- const relativePathWithoutIndex = path . relative ( pri . projectRootPath , file . dir ) ;
54+ const relativePathWithoutIndex = path . relative ( pri . sourceRoot , file . dir ) ;
5555 const routerPath = normalizePath (
5656 `/${ path . relative ( path . join ( pri . sourceRoot , pagesPath . dir ) , relativePathWithoutIndex ) } ` ,
5757 ) ;
5858 const chunkName = _ . camelCase ( routerPath ) || 'index' ;
5959
60- const relativePageFilePath = path . relative ( pri . projectRootPath , `${ file . dir } /${ file . name } ` ) ;
60+ const relativePageFilePath = path . relative ( pri . sourceRoot , `${ file . dir } /${ file . name } ` ) ;
6161 const componentName = safeName ( relativePageFilePath ) + md5 ( relativePageFilePath ) . slice ( 0 , 5 ) ;
6262
6363 return {
@@ -91,7 +91,7 @@ pri.project.onAnalyseProject(files => {
9191 . map ( ( route , index ) => {
9292 if ( route . component ) {
9393 const componentFile = files . find ( file => {
94- const relativePath = path . relative ( pri . projectRootPath , path . join ( file . dir , file . name ) ) ;
94+ const relativePath = path . relative ( pri . sourceRoot , path . join ( file . dir , file . name ) ) ;
9595 return (
9696 ( route . component === relativePath && ! file . isDir && [ '.tsx' , '.md' , '.mdx' ] . indexOf ( file . ext ) > - 1 ) ||
9797 ( path . join ( route . component , 'index' ) === relativePath &&
@@ -107,10 +107,7 @@ pri.project.onAnalyseProject(files => {
107107 const routerPath = route . path ;
108108 const chunkName = _ . camelCase ( routerPath ) || 'index' ;
109109
110- const relativePageFilePath = path . relative (
111- pri . projectRootPath ,
112- `${ componentFile . dir } /${ componentFile . name } ` ,
113- ) ;
110+ const relativePageFilePath = path . relative ( pri . sourceRoot , `${ componentFile . dir } /${ componentFile . name } ` ) ;
114111 const componentName = safeName ( relativePageFilePath ) + md5 ( relativePageFilePath ) . slice ( 0 , 5 ) ;
115112
116113 return {
0 commit comments