QwikDev / qwik

Instant-loading web apps, without effort
https://qwik.dev
MIT License
20.81k stars 1.3k forks source link

[📖] SSG on Cloudflare Pages #4943

Closed mattp0123 closed 3 weeks ago

mattp0123 commented 1 year ago

Suggestion

Add more details of how to config Cloudflare Pages adapter in this section about how to pre-render pages / prevent function invocations. Like:

export default extendConfig(baseConfig, () => {
  return {
    build: {
      ssr: true,
      rollupOptions: {
        input: ['src/entry.cloudflare-pages.tsx', '@qwik-city-plan'],
      },
    },
    plugins: [
      cloudflarePagesAdapter({
        ssg: {
          include: ['/*'], // Pre-render all pages on build time.
        },
      }),
    ],
  };
});
gioboa commented 4 months ago

Here is the piece of code that is managing SSG