-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
70 lines (69 loc) · 1.83 KB
/
vite.config.ts
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// vite define config
import { defineConfig } from 'vite'
// vite plugin
import UnoCSS from 'unocss/vite'
import { presetTagify, presetIcons } from 'unocss'
import extractorSvelte from '@unocss/extractor-svelte'
import { imagetools } from 'vite-imagetools'
import { sveltekit as SvelteKit } from '@sveltejs/kit/vite'
import { SvelteKitPWA } from '@vite-pwa/sveltekit'
// postcss & tailwindcss
import TailwindCSS from 'tailwindcss'
import tailwindConfig from './tailwind.config'
import LightningCSS from 'postcss-lightningcss'
import { presetWebFonts } from 'unocss'
export default defineConfig({
envPrefix: 'URARA_',
build: {
sourcemap: false,
rollupOptions: {
cache: false
}
},
css: {
postcss: {
plugins: [TailwindCSS(tailwindConfig), LightningCSS()]
}
},
plugins: [
UnoCSS({
include: [/\.svelte$/, /\.md?$/, /\.ts$/],
extractors: [extractorSvelte],
presets: [
presetTagify({
extraProperties: (matched: string) => (matched.startsWith('i-') ? { display: 'inline-block' } : {})
}),
presetIcons({ scale: 1.5 }),
presetWebFonts({
provider: 'bunny',
fonts: {
sans: 'Lato',
mono: ['Fira Code', 'Fira Mono:400,700'],
lato: [
{
name: 'Lato',
weights: ['400', '700'],
italic: true
},
{
name: 'sans-serif',
provider: 'none'
}
]
}
})
]
}),
imagetools(),
SvelteKit(),
SvelteKitPWA({
registerType: 'autoUpdate',
manifest: false,
scope: '/',
workbox: {
globPatterns: ['posts.json', '**/*.{js,css,html,svg,ico,png,webp,avif}'],
globIgnores: ['**/sw*', '**/workbox-*']
}
})
]
})