Daydreamer-riri / vite-react-ssg

Static-site generation for React on Vite.
https://vite-react-ssg.netlify.app/
MIT License
114 stars 6 forks source link

[Bug]: getStaticPaths does not work with star segments pattern (*) #14

Closed dinwwwh closed 7 months ago

dinwwwh commented 7 months ago

It work

      {
        path: 'docs/:category/:name',
        lazy: () => import('./pages/doc-detail'),
        entry: './pages/doc-detail.tsx',
        getStaticPaths() {
          return docs.map((doc) => 'docs/' + doc.relativePath)
        },
      },

But it does not work

      {
        path: 'docs/*',
        lazy: () => import('./pages/doc-detail'),
        entry: './pages/doc-detail.tsx',
        getStaticPaths() {
          return docs.map((doc) => 'docs/' + doc.relativePath)
        },
      },
Daydreamer-riri commented 7 months ago

Hi @dinsterizer , thank you for pointing out this issue! Now, you can use star segments in version v0.6.1.

Daydreamer-riri commented 7 months ago

If you have any questions or suggestions, please let me know. ❤️