-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
68 lines (67 loc) · 1.57 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
import path from 'node:path';
import vue from '@vitejs/plugin-vue';
import envify from 'process-envify';
import tailwindColors from 'tailwindcss/colors';
import { presetIcons, presetTypography, presetUno, presetWebFonts } from 'unocss';
import { transformerDirectives } from 'unocss';
import unocss from 'unocss/vite';
import { defineConfig } from 'vite';
import vueRoutes from 'vite-plugin-vue-routes';
export default defineConfig({
define: envify({
API_URL: process.env.API_URL || '',
}),
plugins: [
vue(),
vueRoutes(),
unocss({
presets: [
presetUno(),
presetTypography(),
presetIcons(),
presetWebFonts({
fonts: {
sans: ['Roboto:400,500,600,700,800'],
mono: ['Roboto Mono:400,500,600,700,800'],
},
}),
],
transformers: [transformerDirectives({ enforce: 'pre' })],
theme: {
colors: {
primary: tailwindColors.indigo,
secondary: tailwindColors.neutral,
success: tailwindColors.emerald,
danger: tailwindColors.rose,
warning: tailwindColors.amber,
info: tailwindColors.sky,
},
},
}),
],
resolve: {
alias: {
'~': path.resolve(__dirname, 'src'),
'@': path.resolve(__dirname, 'src'),
},
},
css: {
preprocessorOptions: {
scss: {
api: 'modern',
},
},
},
server: {
proxy: {
'/api': {
target: 'http://127.0.0.1:3000',
ws: true,
},
},
},
test: {
globals: true,
environment: 'happy-dom',
},
});