Skip to content

fix: add missing index.html to SSG and SSR templates#21

Merged
jonlaing merged 2 commits into
mainfrom
fix/ssg-ssr-template-index-html
Jun 25, 2026
Merged

fix: add missing index.html to SSG and SSR templates#21
jonlaing merged 2 commits into
mainfrom
fix/ssg-ssr-template-index-html

Conversation

@jonlaing

Copy link
Copy Markdown
Owner

Summary

Adds an index.html entry file to both the ssg and ssr templates in create-effex. Only the spa template had one previously.

This breaks the SSG build path concretely: the build script vite build && vite build --ssr src/entry.ts requires index.html for Vite's client build to know what to do, and @effex/vite-plugin in SSG mode reads dist/index.html after the client build to extract the hashed asset paths to inject into the generated static HTML pages. No index.html → no dist/index.html → SSG can't find the real script paths.

Both new index.html files mirror the working twitter example's shape — minimal head, a <div id="root">, and <script type="module" src="/src/client.ts"> matching each template's existing client entry.

No CLI changes needed: create-effex's copyTemplate is a generic recursive copy that picks up any file added to a template directory.

Test plan

  • Verify the new files exist in both template directories
  • Run pnpm create effex test-ssg --ssg against this branch and confirm the project builds (pnpm install && pnpm build should produce static HTML in dist/)
  • Run pnpm create effex test-ssr --ssr and confirm the dev server starts (pnpm dev)

Closes #20

🤖 Generated with Claude Code

The SSG and SSR templates lacked an index.html entry, which broke the
client build step ("vite build" in their package.json scripts). This
was load-bearing for SSG specifically because the vite-plugin parses
dist/index.html after the client build to extract real hashed asset
paths to inject into the static HTML output.

Adds index.html to both templates, matching the shape of the working
twitter example. Script tag points to /src/client.ts (which both
templates already have).

Closes #20

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 21, 2026

Copy link
Copy Markdown

Deploying effex with  Cloudflare Pages  Cloudflare Pages

Latest commit: 400948f
Status: ✅  Deploy successful!
Preview URL: https://6ffc65fa.effex.pages.dev
Branch Preview URL: https://fix-ssg-ssr-template-index-h.effex.pages.dev

View logs

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 21, 2026

Copy link
Copy Markdown

Deploying effex-api with  Cloudflare Pages  Cloudflare Pages

Latest commit: 400948f
Status: ✅  Deploy successful!
Preview URL: https://e3e6e570.effex-api.pages.dev
Branch Preview URL: https://fix-ssg-ssr-template-index-h.effex-api.pages.dev

View logs

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@jonlaing jonlaing merged commit 397a611 into main Jun 25, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing index.html in SSG (and SSR) create-effex templates

1 participant