-
Notifications
You must be signed in to change notification settings - Fork 4
/
svelte.config.js
47 lines (46 loc) · 1.45 KB
/
svelte.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import preprocess from 'svelte-preprocess'
import adapterNode from '@sveltejs/adapter-node'
import adapterStatic from '@sveltejs/adapter-static'
import adapterNetlify from '@sveltejs/adapter-netlify'
import mdsvexConfig from './mdsvex.config.js'
import postcss from './postcss.config.js'
import UnoCSS from 'unocss/vite'
import { presetIcons, extractorSvelte } from 'unocss'
import { mdsvex } from 'mdsvex'
export default /** @type {import('@sveltejs/kit').Config} */ {
extensions: ['.svelte', ...mdsvexConfig.extensions],
preprocess: [mdsvex(mdsvexConfig), preprocess()],
kit: {
adapter: Object.keys(process.env).some(key => ['VERCEL', 'CF_PAGES', 'NETLIFY'].includes(key))
? adapterNetlify({ edge: true })
: process.env.ADAPTER === 'node'
? adapterNode({ out: 'build' })
: adapterStatic({
pages: 'build',
assets: 'build',
fallback: null
}),
prerender: { default: true },
vite: {
mode: process.env.MODE || 'production',
envPrefix: 'URARA_',
css: { postcss },
plugins: [
UnoCSS({
extractors: [extractorSvelte],
presets: [
presetIcons({
customizations: {
iconCustomizer: (_collection, _icon, props) => {
props.height = '1.5rem'
props.width = '1.5rem'
return props
}
}
})
]
})
]
}
}
}