Given this svelte.config.js snippet using the @sveltejs/adapter-static adapter, what will be the behavior when building the app?
import adapter from '@sveltejs/adapter-static'; export default { kit: { adapter: adapter({ pages: 'build', assets: 'build', fallback: 'index.html' }) } };
Think about what the fallback option does in the static adapter.
The @sveltejs/adapter-static builds a static site. The fallback: 'index.html' option means unknown routes will serve index.html, enabling SPA-style navigation.
Choose the correct way to import and configure the @sveltejs/adapter-node in svelte.config.js.
Check the import style and how the adapter function is called.
The adapter is the default export and must be imported as adapter. It is a function that must be called to get the adapter instance.
Consider this svelte.config.js snippet:
import adapter from '@sveltejs/adapter-static';
export default {
kit: {
adapter: adapter({
fallback: true
})
}
};Why does this cause a build error?
Check the expected type of the fallback option in the adapter docs.
The fallback option expects a string filename like 'index.html'. Passing true causes a type error.
Given this svelte.config.js snippet:
import adapter from '@sveltejs/adapter-vercel';
export default {
kit: {
adapter: adapter({
edge: true
})
}
};What does the edge: true option do?
Think about what 'edge' means in cloud deployment contexts.
The edge: true option tells the Vercel adapter to build for edge functions, which run closer to users for lower latency.
Choose the correct statement about how SvelteKit adapters affect app deployment.
Consider what adapters do after SvelteKit builds your app.
SvelteKit adapters prepare the app to run on different hosting environments by transforming the build output accordingly.