mirror of
https://github.com/Sevichecc/Urara-Blog.git
synced 2025-04-30 18:59:31 +08:00
33 lines
1 KiB
TypeScript
33 lines
1 KiB
TypeScript
// sveltekit config type
|
|
import type { Config } from '@sveltejs/kit'
|
|
// svelte adapter
|
|
import adapterAuto from '@sveltejs/adapter-auto'
|
|
import adapterNode from '@sveltejs/adapter-node'
|
|
import adapterStatic from '@sveltejs/adapter-static'
|
|
// svelte preprocessor
|
|
import { mdsvex } from 'mdsvex'
|
|
import mdsvexConfig from './mdsvex.config.js'
|
|
import importAssets from 'svelte-preprocess-import-assets'
|
|
import { vitePreprocess } from '@sveltejs/kit/vite'
|
|
|
|
const defineConfig = (config: Config) => config
|
|
|
|
export default defineConfig({
|
|
extensions: ['.svelte', ...(mdsvexConfig.extensions as string[])],
|
|
preprocess: [mdsvex(mdsvexConfig), importAssets(), vitePreprocess()],
|
|
kit: {
|
|
adapter: Object.keys(process.env).some(key => ['VERCEL', 'NETLIFY'].includes(key))
|
|
? adapterAuto()
|
|
: process.env.ADAPTER === 'node'
|
|
? adapterNode({ out: 'build' })
|
|
: adapterStatic({
|
|
pages: 'build',
|
|
assets: 'build',
|
|
fallback: undefined
|
|
}),
|
|
prerender: {
|
|
handleMissingId: 'warn'
|
|
},
|
|
csp: { mode: 'auto' }
|
|
}
|
|
})
|