fix: add missing index.html to SSG and SSR templates#21
Merged
Conversation
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>
Deploying effex with
|
| 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 |
Deploying effex-api with
|
| 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 |
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an
index.htmlentry file to both thessgandssrtemplates increate-effex. Only thespatemplate had one previously.This breaks the SSG build path concretely: the build script
vite build && vite build --ssr src/entry.tsrequiresindex.htmlfor Vite's client build to know what to do, and@effex/vite-pluginin SSG mode readsdist/index.htmlafter the client build to extract the hashed asset paths to inject into the generated static HTML pages. Noindex.html→ nodist/index.html→ SSG can't find the real script paths.Both new
index.htmlfiles mirror the workingtwitterexample'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'scopyTemplateis a generic recursive copy that picks up any file added to a template directory.Test plan
pnpm create effex test-ssg --ssgagainst this branch and confirm the project builds (pnpm install && pnpm buildshould produce static HTML indist/)pnpm create effex test-ssr --ssrand confirm the dev server starts (pnpm dev)Closes #20
🤖 Generated with Claude Code