From 02c2953b64b87f10e8b957152143fc9c161c680b Mon Sep 17 00:00:00 2001 From: EETagent Date: Fri, 20 Jan 2023 13:23:35 +0100 Subject: [PATCH] feat: aliases for paths --- frontend/svelte.config.js | 7 ++++++- frontend/tsconfig.json | 9 ++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/frontend/svelte.config.js b/frontend/svelte.config.js index 2ef33af..a3f4721 100644 --- a/frontend/svelte.config.js +++ b/frontend/svelte.config.js @@ -1,5 +1,6 @@ import adapter from '@sveltejs/adapter-node'; import preprocess from 'svelte-preprocess'; +import path from "path"; import { windi } from 'svelte-windicss-preprocess'; /** @type {import('@sveltejs/kit').Config} */ @@ -8,7 +9,11 @@ const config = { // for more information about preprocessors preprocess: [preprocess(), windi({})], kit: { - adapter: adapter({ out: 'build' }) + adapter: adapter({ out: 'build' }), + alias: { + $i18n: path.resolve('./src/translations'), + } + } }; diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index 8793475..7176a96 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -9,6 +9,13 @@ "resolveJsonModule": true, "skipLibCheck": true, "sourceMap": true, - "strict": true + "strict": true, + "paths": { + "$lib": ["src/lib"], + "$lib/*": ["src/lib/*"], + "$i18n": ["src/translations"], + "$i18n/*": ["src/translations/*"], + "$params": ["src/params"], + } } }