@@ -51,13 +51,13 @@ pri.project.onAnalyseProject(files => {
51
51
return true ;
52
52
} )
53
53
. map ( file => {
54
- const relativePathWithoutIndex = path . relative ( pri . projectRootPath , file . dir ) ;
54
+ const relativePathWithoutIndex = path . relative ( pri . sourceRoot , file . dir ) ;
55
55
const routerPath = normalizePath (
56
56
`/${ path . relative ( path . join ( pri . sourceRoot , pagesPath . dir ) , relativePathWithoutIndex ) } ` ,
57
57
) ;
58
58
const chunkName = _ . camelCase ( routerPath ) || 'index' ;
59
59
60
- const relativePageFilePath = path . relative ( pri . projectRootPath , `${ file . dir } /${ file . name } ` ) ;
60
+ const relativePageFilePath = path . relative ( pri . sourceRoot , `${ file . dir } /${ file . name } ` ) ;
61
61
const componentName = safeName ( relativePageFilePath ) + md5 ( relativePageFilePath ) . slice ( 0 , 5 ) ;
62
62
63
63
return {
@@ -91,7 +91,7 @@ pri.project.onAnalyseProject(files => {
91
91
. map ( ( route , index ) => {
92
92
if ( route . component ) {
93
93
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 ) ) ;
95
95
return (
96
96
( route . component === relativePath && ! file . isDir && [ '.tsx' , '.md' , '.mdx' ] . indexOf ( file . ext ) > - 1 ) ||
97
97
( path . join ( route . component , 'index' ) === relativePath &&
@@ -107,10 +107,7 @@ pri.project.onAnalyseProject(files => {
107
107
const routerPath = route . path ;
108
108
const chunkName = _ . camelCase ( routerPath ) || 'index' ;
109
109
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 } ` ) ;
114
111
const componentName = safeName ( relativePageFilePath ) + md5 ( relativePageFilePath ) . slice ( 0 , 5 ) ;
115
112
116
113
return {
0 commit comments