Entry chunk: signup and the form schemas leave it, build runs without warnings
Docs / docs (push) Successful in 25s
Playwright Tests / test-playwright (1, 2) (push) Failing after 2m34s
Playwright Tests / test-playwright (2, 2) (push) Failing after 22s
pre-commit / pre-commit (push) Failing after 2m18s
Test Backend / test-backend (3.12) (push) Successful in 4m56s
Test Backend / test-backend (3.14) (push) Successful in 4m38s
Compose Smoke Test / test-compose (push) Failing after 23s
Playwright Tests / merge-reports (push) Failing after 2m24s
Docs / docs (push) Successful in 25s
Playwright Tests / test-playwright (1, 2) (push) Failing after 2m34s
Playwright Tests / test-playwright (2, 2) (push) Failing after 22s
pre-commit / pre-commit (push) Failing after 2m18s
Test Backend / test-backend (3.12) (push) Successful in 4m56s
Test Backend / test-backend (3.14) (push) Successful in 4m38s
Compose Smoke Test / test-compose (push) Failing after 23s
Playwright Tests / merge-reports (push) Failing after 2m24s
The entry is 798 kB (259 kB gzipped) instead of 927 kB (298 kB). Signup's `export default` kept it unsplit, and login, recover and reset-password left a bare `z.object(...)` statement in their route stubs (reset-password also read its search through Zod), which held all of Zod and react-hook-form in the entry. The schemas are factories now, reset-password validates its search by hand. The shell routes keep their component in the entry on purpose (`codeSplitGroupings: []`, no `export default`): splitting them out measured about 60 chunks per signed-in screen and a slower flow list. The Zod `@__PURE__` comment warning is filtered and the chunk limit is 850 kB, each with a comment saying why. At 4x CPU on slow 4G the signed-in screens load 5 to 9% sooner, view 6%; login 13% later (the form chunk is one more hop). On a LAN they are within noise. Claude-Session: https://claude.ai/code/session_01SSi5AvZ7pFmySK8zy3NPMh
This commit is contained in:
@@ -15,6 +15,23 @@ export default defineConfig({
|
||||
"@": path.resolve(__dirname, "./src"),
|
||||
},
|
||||
},
|
||||
build: {
|
||||
// The entry holds React, the router, the query client and the shell, and
|
||||
// cannot get below this. A bigger chunk than that is worth a warning.
|
||||
chunkSizeWarningLimit: 850,
|
||||
rollupOptions: {
|
||||
onwarn(warning, defaultHandler) {
|
||||
// Zod's own comments name `@__PURE__`, which Rollup reads as a
|
||||
// misplaced annotation. Nothing to fix on our side.
|
||||
if (
|
||||
warning.code === "INVALID_ANNOTATION" &&
|
||||
warning.id?.includes("/node_modules/zod/")
|
||||
)
|
||||
return
|
||||
defaultHandler(warning)
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
tanstackRouter({
|
||||
target: "react",
|
||||
|
||||
Reference in New Issue
Block a user