web: React18+TDesign 网页控制台(登录/工作台/素材/账号/任务/审核/挑战/通知/审计/成员/设置/admin)
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
import path from 'path';
|
||||
import { loadEnv } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import svgr from '@honkhonk/vite-plugin-svgr';
|
||||
|
||||
const CWD = process.cwd();
|
||||
|
||||
export default (params) => {
|
||||
const { mode } = params;
|
||||
const { VITE_BASE_URL } = loadEnv(mode, CWD);
|
||||
|
||||
return {
|
||||
base: VITE_BASE_URL,
|
||||
resolve: {
|
||||
alias: {
|
||||
assets: path.resolve(__dirname, './src/assets'),
|
||||
components: path.resolve(__dirname, './src/components'),
|
||||
constants: path.resolve(__dirname, './src/constants'),
|
||||
configs: path.resolve(__dirname, './src/configs'),
|
||||
layouts: path.resolve(__dirname, './src/layouts'),
|
||||
modules: path.resolve(__dirname, './src/modules'),
|
||||
pages: path.resolve(__dirname, './src/pages'),
|
||||
styles: path.resolve(__dirname, './src/styles'),
|
||||
utils: path.resolve(__dirname, './src/utils'),
|
||||
services: path.resolve(__dirname, './src/services'),
|
||||
router: path.resolve(__dirname, './src/router'),
|
||||
hooks: path.resolve(__dirname, './src/hooks'),
|
||||
types: path.resolve(__dirname, './src/types'),
|
||||
},
|
||||
},
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
less: {
|
||||
modifyVars: {},
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [svgr(), react()],
|
||||
build: {
|
||||
cssCodeSplit: false,
|
||||
},
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
port: 3003,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://127.0.0.1:8090',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/health': {
|
||||
target: 'http://127.0.0.1:8090',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/ws': {
|
||||
target: 'ws://127.0.0.1:8090',
|
||||
ws: true,
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user