Update Svelte and SvelteKit dependencies

This commit is contained in:
Thomas 2022-08-07 08:14:12 +01:00
parent 9188ae1d93
commit 76d6af7819
6 changed files with 598 additions and 247 deletions

View file

@ -2,20 +2,19 @@
"name": "thomaswilson-sveltekit",
"version": "1.0.0",
"scripts": {
"dev": "svelte-kit dev",
"build": "svelte-kit build",
"package": "svelte-kit package",
"preview": "svelte-kit preview",
"prepare": "svelte-kit sync",
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"prepare": "vite sync",
"check": "svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .",
"format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. ."
},
"devDependencies": {
"@sveltejs/adapter-auto": "next",
"@sveltejs/adapter-auto": "^1.0.0-next.64",
"@sveltejs/adapter-netlify": "^1.0.0-next.51",
"@sveltejs/kit": "next",
"@sveltejs/kit": "^1.0.0-next.405",
"@types/sanitize-html": "^2.6.2",
"@typescript-eslint/eslint-plugin": "^5.10.1",
"@typescript-eslint/parser": "^5.10.1",
@ -28,7 +27,8 @@
"svelte-check": "^2.2.6",
"svelte-preprocess": "^4.10.1",
"tslib": "^2.3.1",
"typescript": "~4.6.2"
"typescript": "~4.6.2",
"vite": "^3.0.4"
},
"type": "module",
"dependencies": {

View file

@ -4,11 +4,11 @@
<meta charset="utf-8" />
<meta name="description" content="" />
<link rel="stylesheet" href="/normalize.css" />
<link rel="icon" href="%svelte.assets%/tw-favicon.ico" />
<link rel="icon" href="%sveltekit.assets%/tw-favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%svelte.head%
%sveltekit.head%
</head>
<body>
<div>%svelte.body%</div>
<div>%sveltekit.body%</div>
</body>
</html>

View file

@ -1,6 +1,6 @@
import allPosts from '../../content/posts.json';
export const get = async ({ url }) => {
export const GET = async ({ url }) => {
try {
const posts = Object.entries(allPosts).map(([key, value]) => ({
...value

View file

@ -1,7 +1,7 @@
import { fetchBlogPostBySlug } from '$lib';
import type { LoadInput } from '@sveltejs/kit';
export const get = async ({ params }: LoadInput) => {
export const GET = async ({ params }: LoadInput) => {
const { slug } = params;
const post = await fetchBlogPostBySlug(slug);

8
vite.config.js Normal file
View file

@ -0,0 +1,8 @@
import { sveltekit } from '@sveltejs/kit/vite';
/** @type {import('vite').UserConfig} */
const config = {
plugins: [sveltekit()]
};
export default config;

811
yarn.lock

File diff suppressed because it is too large Load diff