From ab47ec415e8508145325c5bec105c5e55e4d77ea Mon Sep 17 00:00:00 2001 From: doaortu <113872927+doaortu@users.noreply.github.com> Date: Wed, 10 Jan 2024 19:55:47 +0700 Subject: [PATCH 1/3] fix installation instruction for plain svelte vite beside editing tsconfig.json, we need also update the resolve option of vite.config.js --- apps/www/src/content/installation.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/www/src/content/installation.md b/apps/www/src/content/installation.md index d36b2b0d8..204e78dc9 100644 --- a/apps/www/src/content/installation.md +++ b/apps/www/src/content/installation.md @@ -76,7 +76,7 @@ const config = { }; ``` -If you are _not_ using SvelteKit, then you'll need to update your path aliases in your `tsconfig.json`. +If you are _not_ using SvelteKit, then you'll need to update your path aliases in your `tsconfig.json` and `vite.config.js`. ```json title="tsconfig.json" {4-7} { @@ -89,6 +89,18 @@ If you are _not_ using SvelteKit, then you'll need to update your path aliases i } } ``` +```javascript title="vite.config.js" {1, 5-9} +import path from 'path'; + +export default defineConfig({ + // ... other options + resolve: { + alias: { + $lib: path.resolve("./src/lib"), + } + } +}) +``` ### Run the CLI From 66ec6d11d18815fafa176570ca4f7daa7cdaf9e0 Mon Sep 17 00:00:00 2001 From: doaortu <113872927+doaortu@users.noreply.github.com> Date: Wed, 10 Jan 2024 13:11:00 +0000 Subject: [PATCH 2/3] pnpm format --- apps/www/src/content/installation.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/www/src/content/installation.md b/apps/www/src/content/installation.md index 204e78dc9..a8127b7ad 100644 --- a/apps/www/src/content/installation.md +++ b/apps/www/src/content/installation.md @@ -89,17 +89,18 @@ If you are _not_ using SvelteKit, then you'll need to update your path aliases i } } ``` + ```javascript title="vite.config.js" {1, 5-9} -import path from 'path'; +import path from "path"; export default defineConfig({ // ... other options resolve: { alias: { - $lib: path.resolve("./src/lib"), + $lib: path.resolve("./src/lib") } } -}) +}); ``` ### Run the CLI From f321a17c47e8db2b920aec1665193555e9e90f10 Mon Sep 17 00:00:00 2001 From: AdrianGonz97 <31664583+AdrianGonz97@users.noreply.github.com> Date: Wed, 10 Jan 2024 13:35:41 -0500 Subject: [PATCH 3/3] use vite.config.ts instead --- apps/www/src/content/installation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/www/src/content/installation.md b/apps/www/src/content/installation.md index a8127b7ad..6c2ea1478 100644 --- a/apps/www/src/content/installation.md +++ b/apps/www/src/content/installation.md @@ -76,7 +76,7 @@ const config = { }; ``` -If you are _not_ using SvelteKit, then you'll need to update your path aliases in your `tsconfig.json` and `vite.config.js`. +If you are _not_ using SvelteKit, then you'll need to update your path aliases in your `tsconfig.json` and `vite.config.ts`. ```json title="tsconfig.json" {4-7} { @@ -90,7 +90,7 @@ If you are _not_ using SvelteKit, then you'll need to update your path aliases i } ``` -```javascript title="vite.config.js" {1, 5-9} +```js title="vite.config.ts" {1, 5-9} import path from "path"; export default defineConfig({