Skip to content

Commit

Permalink
chore: setup path alias
Browse files Browse the repository at this point in the history
  • Loading branch information
KoichiKiyokawa committed Oct 4, 2022
1 parent fbf9439 commit 3b80de2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions svelte-kit-graphql/src/routes/+page.server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { client } from 'src/lib/urql';
import { client } from '~/lib/urql';
import type { PageServerLoad } from './$types';
import { graphql } from '../gql/gql';
import { graphql } from '~/gql/gql';

const helloDocument = graphql(/* GraphQL */ `
query Hello {
Expand Down
5 changes: 4 additions & 1 deletion svelte-kit-graphql/svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ const config = {
preprocess: preprocess(),

kit: {
adapter: adapter()
adapter: adapter(),
alias: {
'~': './src'
}
}
};

Expand Down
6 changes: 5 additions & 1 deletion svelte-kit-graphql/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true
"strict": true,
"baseUrl": ".",
"paths": {
"~/*": ["src/*"]
}
}
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
//
Expand Down

0 comments on commit 3b80de2

Please sign in to comment.