Skip to content

Commit

Permalink
Replace kit aliases with paths in tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
OLILHR committed Nov 4, 2024
1 parent cba7e19 commit afad7a2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
11 changes: 9 additions & 2 deletions src/routes/ebd/[...ebd]/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,24 @@ import { prerenderEntries } from "$server/prerender-entries";

import type { PageServerLoad } from "./$types";

interface RouteEntry {
ebd: string;
filePath: string;
}

export function entries() {
const routes = prerenderEntries();
return routes.map((route) => ({
return routes.map((route: RouteEntry) => ({
ebd: route.ebd,
}));
}

export const load: PageServerLoad = async ({ params }) => {
const [formatVersion, ebdFile] = params.ebd.split("/");
const availableVersions = getFormatVersions();
const version = availableVersions.find((v) => v.code === formatVersion);
const version = availableVersions.find(
(v: { code: string }) => v.code === formatVersion,
);

return {
formatVersion: version,
Expand Down
4 changes: 0 additions & 4 deletions svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ const config = {
preprocess: vitePreprocess(),
kit: {
adapter: adapter({
alias: {
$server: "src/server",
$src: "src",
},
pages: "build",
assets: "build",
fallback: "404.html",
Expand Down
6 changes: 6 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"allowJs": true,
"baseUrl": ".",
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
"paths": {
"$lib/*": ["src/lib/*"],
"$src/*": ["src/*"],
"$server/*": ["src/server/*"]
},
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
Expand Down

0 comments on commit afad7a2

Please sign in to comment.