Repository navigation
Docs: serving static builds with serve.json - #68
Merged
Merged
Conversation
…builds Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rding Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.
What
Expands the "Static builds" bullet in
skills/renderdiff/reference.md(the only place that documents serving): whatservealready does, how to match the host's trailing-slash behaviour with aserve.jsonpassed via-c, and how to serve a docs build under the marketing one on a single origin.Why
A static server whose trailing-slash or subpath behaviour differs from the real host makes routes 404 or redirect on one side only, which shows up as false diffs.
The #59 report said
npx servedoesn't resolve slashless URLs to.html. That didn't reproduce on serve 14.2.6 (serve-handler 6.1.7): clean URLs are on by default (/about->about.html,/docs->docs/index.html,/about.html-> 301/about). The real gaps are:{ "trailingSlash": true }redirects/docs->/docs/;falsethe reverse.rewritesonly remap paths inside the one served dir, get no clean-URL resolution and have no fallthrough, so they can't mount a second build. A directory symlink (ln -s "$PWD/docs/dist" dist/docs) works with no config (no"symlinks": trueneeded); it lives insidedist, so a rebuild that wipesdistdrops it and it has to be redone.Also documented:
-cresolves relative to the served dir (so-c ../serve.jsonkeeps the config outsidedist, safe from rebuilds and not served as/serve.json), and the config is read at startup.README and
docs/don't cover serving today, so they're left alone.Verified
npx serve@14.2.6against throwaway fixture dirs andcurl -I(clean URLs,trailingSlashtrue/false,-cpath resolution, rewrites limitation, symlinked dir with nested pages, restart needed after edit).npm run format:check,npm run lint,npm testpass (docs-only change).Fixes #52
🤖 Generated with Claude Code