Skip to content

Commit

Permalink
update: switch to static adapter and configure build options in svelt…
Browse files Browse the repository at this point in the history
…e.config.js; update package.json and pnpm-lock.yaml
  • Loading branch information
Tsuzat committed Dec 27, 2024
1 parent 8b261d5 commit 95451f6
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"dependencies": {
"@fontsource-variable/dm-sans": "^5.1.0",
"@fontsource-variable/fira-code": "^5.1.0",
"@sveltejs/adapter-static": "^3.0.8",
"@tailwindcss/typography": "^0.5.15",
"lottie-web": "^5.12.2",
"shiki": "^1.24.4"
Expand Down
12 changes: 12 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions src/routes/+page.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
export const prerender = true;
export const ssr = true;

import type { MarkdownPostMetadataAndSlug } from '$lib/utils';

import type { PageLoad } from './$types';
Expand Down
19 changes: 13 additions & 6 deletions svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mdsvex, escapeSvelte } from 'mdsvex';
import adapter from '@sveltejs/adapter-auto';
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
import { codeToHtml } from 'shiki';

Expand Down Expand Up @@ -97,13 +97,20 @@ const mdsvexConfigs = {
const config = {
// Consult https://svelte.dev/docs/kit/integrations
// for more information about preprocessors
preprocess: [vitePreprocess(), mdsvex(mdsvexConfigs)],
preprocess: [vitePreprocess({ script: true }), mdsvex(mdsvexConfigs)],

kit: {
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
adapter: adapter()
adapter: adapter({
pages: 'build',
assets: 'build',
fallback: 'index.html',
precompress: true,
strict: false
})
},
compilerOptions: {
css: 'injected',
enableSourcemap: true
},

extensions: ['.svelte', '.md']
Expand Down

0 comments on commit 95451f6

Please sign in to comment.