svelte-kanban
svelte-kanban copied to clipboard
Add $stores alias
Adding a new path alias for the latest SvelteKit and Vite has proven to be very difficult. I could get everything working except for npm build
which causes files under dist/ to still contain $stores . However, $lib is properly replaced
This does not work:
vite.config.ts:
resolve: {
alias: {
$lib: path.resolve("./src/lib"),
$stores: path.resolve("./src/lib/stores")
}
tsconfig.js:
"compilerOptions": {
"paths": {
"$lib": ["./src/lib"],
"$lib/*": ["./src/lib/*"],
"$stores": ["./src/lib/stores"],
"$stores/*": ["./src/lib/stores/*"]
}
The latest SvelteKit doesn't require changing vite or ts config files. Instead, aliases are added to the svelte config file.