-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
52 lines (50 loc) · 1.25 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
import { defineConfig } from 'vite';
import path from 'path';
import packageJson from './package.json';
import VuePlugin from '@vitejs/plugin-vue';
import PurgeIcons from 'vite-plugin-purge-icons';
import brotli from 'rollup-plugin-brotli';
import { PluginTrapAuth } from '@traptitech/vite-plugin-trap-auth';
import autoprefixer from 'autoprefixer';
import postcssNormalize from 'postcss-normalize';
import dns from 'node:dns';
dns.setDefaultResultOrder('ipv4first');
export default defineConfig(({ mode }) => ({
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
},
},
server: {
// proxy: {
// '/api': {
// target: 'https://booq-dev.trapti.tech',
// changeOrigin: true,
// },
// },
},
css: {
preprocessorOptions: {
scss: {
additionalData: `
@use "sass:math";
@import "@/styles/common.scss";
`,
},
},
postcss: {
plugins: [
postcssNormalize(),
...(mode === 'production' ? [autoprefixer()] : []),
],
},
devSourcemap: true,
},
define: {
__VERSION__: `"${packageJson.version}"`,
},
plugins: [VuePlugin(), PurgeIcons(), brotli(), PluginTrapAuth()],
optimizeDeps: {
include: ['@iconify/iconify'],
},
}));