fix(build): support trailing-slash static exports - #3081
Merged
Conversation
commit: |
Contributor
|
Contributor
Performance benchmarksCompared 1 improved · 0 regressed · 8 within ±1.5%
View detailed results and traces 🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head |
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
dist/clientartifact through Cloudflare Static Assets with no Worker entry point404.htmland404/index.htmlfor trailing-slash parity with Next.jsExample coverage
The new
examples/static-exportapp demonstrates Server and Client Components,generateStaticParams, catch-all params,generateMetadata, browser hydration,localStorage,useSearchParams, custom 404 and metadata files,getStaticProps, andgetStaticPaths.The example documents the request-time features that are intentionally unavailable to static exports. It also calls out the remaining parity gap for explicitly static App Router
GETRoute Handlers.Validation
vp test run tests/app-router-static-export.test.ts tests/static-export.test.ts tests/prerender.test.tsvp test run tests/pages-router.test.ts -t "Static export"PLAYWRIGHT_PROJECT=static-export VINEXT_E2E_BASE_URL=http://127.0.0.1:4181 vp run test:e2e -- tests/e2e/static-export/app-router.spec.ts tests/e2e/static-export/pages-router.spec.tsvp checkpnpm build && pnpm verifyinexamples/static-exportpnpm exec wrangler deploy --config deploy/wrangler.jsonc --dry-runThe focused Vitest runs passed 123 prerender/static-export tests plus 7 Pages Router static-export tests. The static-export Playwright project passed 19 tests, and the artifact verifier checked 16 representative files across a 50-file export.