42 行
901 B
TypeScript
42 行
901 B
TypeScript
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import svgrPlugin from '@arco-plugins/vite-plugin-svgr';
|
|
import vitePluginForArco from '@arco-plugins/vite-react';
|
|
import setting from './src/settings.json';
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
resolve: {
|
|
alias: [{ find: '@', replacement: '/src' }],
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://127.0.0.1:9000',
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/api/, ''),
|
|
},
|
|
},
|
|
},
|
|
plugins: [
|
|
react(),
|
|
svgrPlugin({
|
|
svgrOptions: {},
|
|
}),
|
|
vitePluginForArco({
|
|
theme: '@arco-themes/react-arco-pro',
|
|
modifyVars: {
|
|
'arcoblue-6': setting.themeColor,
|
|
},
|
|
}),
|
|
],
|
|
css: {
|
|
preprocessorOptions: {
|
|
less: {
|
|
javascriptEnabled: true,
|
|
},
|
|
},
|
|
},
|
|
});
|