-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
37 lines (33 loc) · 1.01 KB
/
vite.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
import { svelte } from '@sveltejs/vite-plugin-svelte'
import routify from '@roxi/routify/vite-plugin'
import { defineConfig } from 'vite'
import { mdsvex } from 'mdsvex'
import { resolve } from 'path'
import postCssNesting from 'postcss-nesting'
const production = process.env.NODE_ENV === 'production'
export default defineConfig({
clearScreen: false,
resolve: { alias: { '@': resolve('src') } },
test: {
environment: 'jsdom',
globals: true,
server: {
deps: { inline: ["@roxi/routify"] },
}
},
plugins: [
routify({
render: { ssr: production, ssg: production },
}),
svelte({
compilerOptions: {
dev: !production,
hydratable: !!process.env.ROUTIFY_SSR_ENABLE,
},
extensions: ['.md', '.svelte'],
preprocess: [mdsvex({ extension: 'md' })],
}),
],
css: { postcss: { plugins: [postCssNesting()] } },
server: { port: 1337 },
})