vitejs / vite-plugin-react-pages

A vite framework for building react app. Especially suitable for document site and demos/playgrounds of react components.
https://vitejs.github.io/vite-plugin-react-pages/
MIT License
459 stars 70 forks source link

Pages generated from src can not access directly #148

Closed yunsii closed 1 year ago

yunsii commented 1 year ago

For example: https://starter-vite-react-library.yuns.love/components/Button

Only accessd by opening https://starter-vite-react-library.yuns.love firstly, and then click to /components and /components/Button manually. I think the plugin should generate related static pages.

csr632 commented 1 year ago

It generate static pages (in dist/) when you run vite-pages ssr (npm run ssr) image

yunsii commented 1 year ago

it can not use plugin option to generate? the usage out of my imagination 😂 Moreover, the render mode is more suitable called SSG.

yunsii commented 1 year ago

My project usage: vite-pages ssr --configFile vite.docs.config.ts according to https://github.com/vitejs/vite-plugin-react-pages/blob/e8425d3e2df497ec6ff431bf46239a91e87b1599/packages/react-pages/src/node/cli.ts#L40

OMG, it seems support SSG from long long ago: https://github.com/vitejs/vite-plugin-react-pages/blob/6d7f5d37dafd52821dbeefb510eed481213a63bc/doc-site/pages/%24.mdx#L34C5-L34C50 It's my fault 😢

csr632 commented 1 year ago

Sorry for lack of documentation of this behaviour.

yunsii commented 1 year ago

Done, the link: starter-vite-react-library.yuns.love/components/Button works very well 🎉