Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to import the adapter for SvelteKit.
Svelte
import adapter from '@sveltejs/kit/[1]';
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing an adapter for a different platform than intended.
Forgetting to import the adapter before using it.
✗ Incorrect
The adapter-static is commonly used for static site generation in SvelteKit.
2fill in blank
mediumComplete the code to configure the adapter in svelte.config.js.
Svelte
export default {
kit: {
adapter: [1]()
}
}; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong adapter variable name.
Forgetting the parentheses to call the adapter function.
✗ Incorrect
The imported adapter is usually named adapter, so you call it as adapter() in the config.
3fill in blank
hardFix the error in the adapter import statement.
Svelte
import adapter from '@sveltejs/kit/[1]';
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using underscores instead of dashes.
Adding file extensions in the import path.
✗ Incorrect
The correct package name uses dashes, not underscores or camelCase.
4fill in blank
hardFill both blanks to configure the adapter with options.
Svelte
adapter: [1]({ pages: '[2]' })
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong variable names for the adapter.
Setting the pages option to an incorrect folder name.
✗ Incorrect
You call the adapter function adapter() and set the pages option to the folder static.
5fill in blank
hardFill all three blanks to complete the adapter configuration with fallback.
Svelte
adapter: [1]({ pages: '[2]', fallback: '[3]' })
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the fallback file name.
Using incorrect folder names for pages.
✗ Incorrect
The adapter is called adapter(), the pages folder is static, and the fallback file is index.html.