Performance: Adapter configuration
Adapter configuration affects how the SvelteKit app is built and deployed, impacting server response time and initial page load speed.
import adapter from '@sveltejs/adapter-node'; export default { kit: { adapter: adapter() } };
import adapter from '@sveltejs/adapter-static'; export default { kit: { adapter: adapter() } };
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Static Adapter on Dynamic Server | More client DOM updates | Multiple reflows due to client hydration | Higher paint cost from larger bundle | [X] Bad |
| Node Adapter on Dynamic Server | Minimal client DOM updates | Single reflow on initial render | Lower paint cost with smaller bundle | [OK] Good |
svelte.config.js?kit property as a function call adapter().svelte.config.js snippet, what adapter is being used and what does it imply?
import adapter from '@sveltejs/adapter-node';
export default {
kit: {
adapter: adapter()
}
};svelte.config.js?
import adapter from '@sveltejs/adapter-static';
export default {
adapter: adapter()
};kit property, not directly on the export object.export default { kit: { adapter: adapter() } }.svelte.config.js to achieve this, and why?Pass the test and this pattern moves unknown