- Published on
Using Aliases in SvelteKit
- Authors
- Name
- hwahyeon
To use aliases in SvelteKit, you need to add the alias configuration in the kit section of the svelte.config.js
file.
const config = {
kit: {
alias: {
$components: 'src/lib/components',
},
},
}
With this setup, you can import modules as follows:
import { ComponentA } from '$components'