vue-vben-admin/vite.config.ts

66 lines
1.6 KiB
TypeScript

/*
* @Author: 刘妍
* @Date: 2024-01-13 13:04:15
* @LastEditors: Do not edit
* @LastEditTime: 2024-01-17 16:06:35
* @FilePath: \费县天空地大屏正式代码e:\新架构\vue-vben-admin\vite.config.ts
* @Description:
*/
import { defineApplicationConfig } from '@vben/vite-config';
import { mars3dPlugin } from 'vite-plugin-mars3d';
import path, { resolve } from 'path';
export default defineApplicationConfig({
overrides: {
optimizeDeps: {
include: [
'echarts/core',
'echarts/charts',
'echarts/components',
'echarts/renderers',
'qrcode',
'@iconify/iconify',
'ant-design-vue/es/locale/zh_CN',
'ant-design-vue/es/locale/en_US',
],
},
server: {
proxy: {
'/basic-api': {
target: 'http://localhost:3000',
changeOrigin: true,
ws: true,
rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''),
// only https
// secure: false
},
'/upload': {
target: 'http://localhost:3300/upload',
changeOrigin: true,
ws: true,
rewrite: (path) => path.replace(new RegExp(`^/upload`), ''),
},
},
warmup: {
clientFiles: ['./index.html', './src/{views,components}/*'],
},
},
define: {
'process.env': {
BASE_URL: '/',
},
},
css: {
preprocessorOptions: {
less: {
javascriptEnabled: true,
additionalData: `
@import "${path.resolve(__dirname, 'src/mars/components/mars-ui/base.less')}";
`,
},
},
},
plugins: [mars3dPlugin()],
},
});