HiDeoo / starlight-blog

Starlight plugin to add a blog to your documentation
https://starlight-blog-docs.vercel.app
MIT License
106 stars 10 forks source link

Astro's `srcDir` seems to be not supported #60

Closed roll closed 18 hours ago

roll commented 3 days ago

Describe the bug

The plugin doesn't seem to be taking into an account srcDir

To Reproduce

  1. Have a config like this
    // https://astro.build/config
    export default defineConfig({
    srcDir: ".",
    }
  2. Setup the blog
  3. Run astro build
  4. Fail with [vite]: Rollup failed to resolve import "/src/content/config.ts" from "virtual:starlight/collection-config".

Expected behavior

It builds instead of failing

How often does this bug happen?

Every time

System Info

No response

Additional Context

A temporary fix is just to have src/content/config.ts copy as well

HiDeoo commented 3 days ago

Thanks for the report 🙌

This turns out to be an issue in Starlight and I've opened https://github.com/withastro/starlight/pull/2054 to fix the issue.

HiDeoo commented 18 hours ago

Starlight 0.24.5 was just released with the fix for this issue.

I just tested locally with a custom srcDir using that latest Starlight version and now the build works fine as expected.

Thanks again for your report 🙌