-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
60 lines (57 loc) · 1.58 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
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import { VitePluginFonts } from 'vite-plugin-fonts'
import { createHtmlPlugin } from 'vite-plugin-html'
import viteImagemin from 'vite-plugin-imagemin'
import 'tailwindcss-animate' // Changed to static import
import config from './config.js'
import postcss from './postcss.config.js'
const { imagemin } = config
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
viteImagemin(imagemin),
createHtmlPlugin({
minify: true,
entry: '/client/src/main.tsx'
}),
VitePluginFonts({
// Custom fonts
custom: {
families: [
{
name: 'CascadiaCodePL',
src: './client/src/assets/fonts/*.woff2'
},
{
name: 'Gilroy',
src: './client/src/assets/fonts/*.woff2'
},
{
name: 'FHGiselle',
src: './client/src/assets/fonts/*.woff2'
}
],
display: 'swap',
preload: true,
prefetch: false,
injectTo: 'head-prepend'
}
})
],
css: {
postcss
},
resolve: {
alias: [
{ find: '@/', replacement: '/client/src' },
{ find: '@/Public', replacement: '/public' },
{ find: '@/Images', replacement: '/client/src/assets/images' },
{ find: '@/Fonts', replacement: '/public/fonts' },
{ find: '@/scenes', replacement: '/public/scenes' },
{ find: '@/lib', replacement: '../../../../lib' },
{ find: '@/Components', replacement: '/client/src/components' }
]
}
})