Daydreamer-riri / vite-react-ssg

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

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

Closed unnoq closed 8 months ago

unnoq commented 8 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 8 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 8 months ago

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