SvelteKit $lib Alias Setup

Rami Awar
Aug 3, 2022

Two steps are needed to get the $lib alias working in your SvelteKit project:

  1. Add the following paths key to your tsconfig.json or jsconfig.json

2. Add the following resolve section to your vite.config.js file.

That’s a wrap! Reload your editor for the changes to take effect.

--

--