-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
34 lines (32 loc) · 849 Bytes
/
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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tsconfigPaths from 'vite-tsconfig-paths'
import fs from 'fs';
import lessToJS from 'less-vars-to-js';
import { resolve } from 'path';
const pathResolver = (path: string) => resolve(__dirname, path);
const themeVariables = lessToJS(
fs.readFileSync(pathResolver('./src/antd-custom.less'), 'utf8'),
);
// https://vitejs.dev/config/
export default defineConfig({
base: './',
plugins: [react(), tsconfigPaths()],
css: {
preprocessorOptions: {
less: {
javascriptEnabled: true,
modifyVars: themeVariables,
},
},
},
// server: {
// fs: {
// // Allow serving files from one level up to the project root
// allow: ['..']
// },
// proxy: {
// '/api': 'ws://125.214.0.120:81'
// }
// },
})