Skip to content

Symbolic linked srcDir makes redirects #4976

@ryansuhartanto

Description

@ryansuhartanto

Describe the bug

I set up my monorepo structure into this using ln -s ../../docs .:

docs/
apps/docs/
├── docs -> ../../docs
└── .vitepress

I plan to docs is managed outside of the VitePress project and configured my .vitepress/config.ts into this:

export default defineConfig({
  srcDir: "docs",
  // ...
});

But running vitepress dev would redirects the site into http://localhost:5173/docs.

Reproduction

Checkout this for a similar issue: https://stackblitz.com/edit/vitepress-symlink.

Expected behavior

Should not redirect from http://localhost:5173/ to http://localhost:5173/docs.

System Info

From the Stackblitz:

  System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 20.19.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions