Repository navigation
chore: simplify a few server and build helpers - #17531
fru1tworld wants to merge 1 commit into
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/bd2713747c5e49653e5c88e3cb5aa56544ce9022Open in Note This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed. |
|
elliott-with-the-longest-name-on-github
left a comment
There was a problem hiding this comment.
Let's add a patch changeset for this just so that it's easier to find in the changelog if it somehow creates any regressions.
A few small cleanups I noticed while reading the server runtime and build code. No behaviour changes.
write_parent_tsconfigpassestransformtonormalize_config, which already applies it, instead of applying it again itselfstate.prerendering || state.prerender_default === truewas repeated 9 times acrossrender.js,page/index.jsandload_data.js. It's now anis_prerendering(state)helper inruntime/server/utils.jsprerender.jsuses the existingwritehelper fromcore/sync/utils.jsfor the twomkdirSync+writeFileSyncpairsrespond.jsbuilds itsmodwithObject.fromEntriesinstead of areduceindexOf(...) === -1→includes(...),forEach→for...of, andredirect_responsereturns theResponsedirectlyRan
pnpm -F @sveltejs/kit test:unit,pnpm -F @sveltejs/kit check, and theprerendering-test-basicssuite.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits