Migrated from svelte vite plugin to sveltekit

This commit is contained in:
2025-01-10 16:11:30 +00:00
parent c012c04729
commit d7e2e0f9f3
43 changed files with 133 additions and 62 deletions

2
.gitignore vendored
View File

@@ -38,3 +38,5 @@ package-lock.json
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.svelte-kit

BIN
bun.lockb

Binary file not shown.

12
jsconfig.json Normal file
View File

@@ -0,0 +1,12 @@
{
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"module": "NodeNext",
"moduleResolution": "NodeNext"
}
}

View File

@@ -1,21 +1,49 @@
{
"name": "vite-svelte-starter",
"version": "0.1.0",
"description": "",
"keywords": [],
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^2.0.0",
"svelte": "^4.2.3",
"svelte-preprocess": "^5.1.3",
"sass": "^1.72.0",
"vite": "^4.0.3"
},
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"browserslist": ["> 1%", "last 2 versions", "not dead"],
"type": "module",
"private": true
"name": "am-d-model.eu",
"version": "0.0.1",
"scripts": {
"dev": "vite dev",
"build": "vite build && npm run package",
"preview": "vite preview",
"package": "svelte-kit sync && svelte-package && publint",
"prepublishOnly": "npm run package"
},
"files": [
"dist",
"!dist/**/*.test.*",
"!dist/**/*.spec.*"
],
"sideEffects": [
"**/*.css"
],
"svelte": "./dist/index.js",
"types": "./dist/index.d.ts",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"svelte": "./dist/index.js"
}
},
"peerDependencies": {
"svelte": "^5.0.0"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.3.1",
"@sveltejs/kit": "^2.15.2",
"@sveltejs/package": "^2.3.7",
"@sveltejs/vite-plugin-svelte": "^4.0.4",
"svelte": "^5.17.3",
"svelte-preprocess": "^5.1.4",
"sass": "^1.83.1",
"autoprefixer": "^10.4.20",
"publint": "^0.2.12",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vite": "^5.4.11"
},
"dependencies": {
"@tailwindcss/forms": "^0.5.10"
},
"private": true
}

6
postcss.config.js Normal file
View File

@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
};

View File

@@ -1,12 +0,0 @@
<script>
import LandingPage from "./LandingPage/LandingPage.svelte";
import "./vars.css";
import "./styles.css";
</script>
<div>
<LandingPage />
</div>
<style>
</style>

3
src/app.css Normal file
View File

@@ -0,0 +1,3 @@
@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities'

15
src/app.html Normal file
View File

@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div>%sveltekit.body%</div>
</body>
</html>

View File

@@ -1,8 +1,7 @@
<script>
import "./NavigationFooter.scss";
import "../shared_components/ScrollToTop.svelte";
import ScrollToTop from "./ScrollToTop.svelte";
import Link from "./Link.svelte";
import "$lib/styles/NavigationFooter.scss";
import ScrollToTop from "$lib/components/ScrollToTop.svelte";
import Link from "$lib/components/Link.svelte";
</script>
<div class="navigation-footer">

View File

@@ -5,9 +5,9 @@
export let button_text_class;
export let display_title = true;
import "./NavigationHeader.scss";
import Button from "./Button.svelte";
import Link from "./Link.svelte";
import "$lib/styles/NavigationHeader.scss";
import Button from "$lib/components/Button.svelte";
import Link from "$lib/components/Link.svelte";
</script>
<div class={$$props.class}>

View File

@@ -1,5 +1,5 @@
@import url('https://fonts.cdnfonts.com/css/martel-2');
@import url('https://fonts.cdnfonts.com/css/assistant');
@import url("https://fonts.cdnfonts.com/css/martel-2");
@import url("https://fonts.cdnfonts.com/css/assistant");
:root {
/* Colors */

View File

@@ -1,7 +0,0 @@
import App from './App.svelte';
const app = new App({
target: document.getElementById('app'),
})
export default app

View File

@@ -0,0 +1,8 @@
<script>
import "$lib/styles/styles.css";
import "$lib/styles/vars.css";
import "../app.css";
let { children } = $props();
</script>
{@render children()}

View File

@@ -1,8 +1,8 @@
<script>
import "./LandingPage.scss";
import NavigationHeader from "../shared_components/NavigationHeader.svelte";
import NavigationHeader from "$lib/components/NavigationHeader.svelte";
import "./NavigationHeader.scss";
import NavigationFooter from "../shared_components/NavigationFooter.svelte";
import NavigationFooter from "$lib/components/NavigationFooter.svelte";
import Splash from "./Splash.svelte";
import InfoScroll from "./InfoScroll.svelte";
import BottomCall from "./BottomCall.svelte";

View File

@@ -1,6 +1,6 @@
<script>
import "./BottomCall.scss";
import Button from "../shared_components/Button.svelte";
import Button from "$lib/components/Button.svelte";
</script>
<div class="btmcall">

View File

@@ -1,6 +1,6 @@
<script>
import "./Splash.scss";
import Button from "../shared_components/Button.svelte";
import Button from "$lib/components/Button.svelte";
</script>
<div class="splash">

View File

@@ -0,0 +1 @@
About page placeholder

View File

@@ -0,0 +1 @@
Contact page placeholder

View File

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 81 KiB

View File

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View File

Before

Width:  |  Height:  |  Size: 532 B

After

Width:  |  Height:  |  Size: 532 B

BIN
static/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

View File

Before

Width:  |  Height:  |  Size: 1006 B

After

Width:  |  Height:  |  Size: 1006 B

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 702 B

After

Width:  |  Height:  |  Size: 702 B

View File

@@ -1,8 +1,12 @@
import preprocess from "svelte-preprocess";
import adapter from '@sveltejs/adapter-auto';
const config = {
preprocess: preprocess({}),
};
export default config;
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: preprocess({}),
kit: {
adapter: adapter()
}
};
export default config;

12
tailwind.config.js Normal file
View File

@@ -0,0 +1,12 @@
import forms from '@tailwindcss/forms';
/** @type {import('tailwindcss').Config} */
export default {
content: ['./src/**/*.{html,js,svelte,ts}'],
theme: {
extend: {}
},
plugins: [forms]
};

View File

@@ -1,7 +1,6 @@
import { defineConfig } from 'vite'
import {svelte} from '@sveltejs/vite-plugin-svelte'
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [svelte()],
})
plugins: [sveltekit()]
});