diff --git a/front/jsconfig.json b/front/jsconfig.json
index 5696a2d..b59e3c4 100644
--- a/front/jsconfig.json
+++ b/front/jsconfig.json
@@ -22,7 +22,10 @@
* Typecheck JS in `.svelte` and `.js` files by default.
* Disable this if you'd like to use dynamic types.
*/
- "checkJs": true
+ "checkJs": true,
+ "paths": {
+ "%": ["./src"]
+ }
},
/**
* Use global.d.ts instead of compilerOptions.types
diff --git a/front/public/temp.jpg b/front/public/temp.jpg
new file mode 100644
index 0000000..afd1eb1
Binary files /dev/null and b/front/public/temp.jpg differ
diff --git a/front/src/App.svelte b/front/src/App.svelte
index 7039ab7..017c0c3 100644
--- a/front/src/App.svelte
+++ b/front/src/App.svelte
@@ -2,7 +2,7 @@
import Router from 'svelte-spa-router';
import { replace, link } from 'svelte-spa-router';
import active from 'svelte-spa-router/active'
- import routes from './routes';
+ import routes from '%/routes.js';
let oldLocation = undefined;
let showNavBar = false;
@@ -22,43 +22,56 @@
{#if showNavBar }
{/if}
-
Link to the /about page
+ + diff --git a/front/src/routes.js b/front/src/routes.js index 6474b9c..db096b9 100644 --- a/front/src/routes.js +++ b/front/src/routes.js @@ -1,22 +1,22 @@ import { wrap } from "svelte-spa-router/wrap"; -import PageLoading from "./routes/PageLoading.svelte"; -import Page404 from "./routes/Page404.svelte"; +import PageLoading from "%/pages/PageLoading.svelte"; +import Page404 from "%/pages/Page404.svelte"; const routes = { "/": wrap({ - asyncComponent: () => import("./routes/PageIndex.svelte"), + asyncComponent: () => import("%/pages/index/PageIndex.svelte"), loadingComponent: PageLoading, conditions: [], userData: { showNavBar: true }, }), "/contact": wrap({ - asyncComponent: () => import("./routes/PageContact.svelte"), + asyncComponent: () => import("%/pages/PageContact.svelte"), loadingComponent: PageLoading, conditions: [], userData: { showNavBar: true }, }), "/cart": wrap({ - asyncComponent: () => import("./routes/PageShoppingCart.svelte"), + asyncComponent: () => import("%/pages/PageShoppingCart.svelte"), loadingComponent: PageLoading, conditions: [], userData: { showNavBar: true }, diff --git a/front/src/routes/PageIndex.svelte b/front/src/routes/PageIndex.svelte deleted file mode 100644 index bdccd54..0000000 --- a/front/src/routes/PageIndex.svelte +++ /dev/null @@ -1,2 +0,0 @@ -aurgh
diff --git a/front/src/styles/main.scss b/front/src/styles/main.scss new file mode 100644 index 0000000..f9bc259 --- /dev/null +++ b/front/src/styles/main.scss @@ -0,0 +1,9 @@ +*, *::before, *::after { + box-sizing: border-box; + margin: 0; +} +body, #app { + min-height: 100vh; + display: flex; + flex-direction: column; +} diff --git a/front/vite.config.js b/front/vite.config.js index d701969..a642a9e 100644 --- a/front/vite.config.js +++ b/front/vite.config.js @@ -3,5 +3,13 @@ import { svelte } from '@sveltejs/vite-plugin-svelte' // https://vitejs.dev/config/ export default defineConfig({ - plugins: [svelte()], + plugins: [ + svelte(), + ], + base: './', + resolve: { + alias: { + '%': __dirname + '/src', + } + }, })