Skip to content

Commit

Permalink
handle symlinked pages directory
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Jul 26, 2024
1 parent ce8696d commit f77c529
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions crates/next-core/src/pages_structure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,20 @@ pub async fn find_pages_structure(
next_router_root: Vc<FileSystemPath>,
page_extensions: Vc<Vec<RcStr>>,
) -> Result<Vc<PagesStructure>> {
let pages_root = project_root.join("pages".into());
let pages_root = project_root
.join("pages".into())
.realpath()
.resolve()
.await?;
let pages_root = Vc::<FileSystemPathOption>::cell(
if *pages_root.get_type().await? == FileSystemEntryType::Directory {
Some(pages_root)
} else {
let src_pages_root = project_root.join("src/pages".into());
let src_pages_root = project_root
.join("src/pages".into())
.realpath()
.resolve()
.await?;
if *src_pages_root.get_type().await? == FileSystemEntryType::Directory {
Some(src_pages_root)
} else {
Expand Down

0 comments on commit f77c529

Please sign in to comment.