|
|
import { defineApplicationConfig } from '@vben/vite-config';
|
|
|
import { mars3dPlugin } from 'vite-plugin-mars3d';
|
|
|
|
|
|
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',
|
|
|
'@/../lib/vform/designer.umd.js',
|
|
|
],
|
|
|
},
|
|
|
build: {
|
|
|
/* 其他build生产打包配置省略 */
|
|
|
//...
|
|
|
target: 'esnext',
|
|
|
commonjsOptions: {
|
|
|
include: [/node_modules|lib/, /node_modules|packages/], //这里记得把lib目录加进来,否则生产打包会报错!!
|
|
|
},
|
|
|
},
|
|
|
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`), ''),
|
|
|
},
|
|
|
'/sltest': {
|
|
|
target: 'http://192.168.10.131:9025/',
|
|
|
changeOrigin: true, //是否跨域
|
|
|
rewrite: (path) => path.replace(/^\/sltest/, ''), //如果后端接口有sltest前缀就不需要替换
|
|
|
// ws: true, //是否代理 websockets
|
|
|
// secure: true, //是否https接口
|
|
|
},
|
|
|
},
|
|
|
warmup: {
|
|
|
clientFiles: ['./index.html', './src/{views,components}/*'],
|
|
|
},
|
|
|
},
|
|
|
define: {
|
|
|
'process.env': {
|
|
|
BASE_URL: '/',
|
|
|
},
|
|
|
},
|
|
|
css: {
|
|
|
preprocessorOptions: {
|
|
|
less: {
|
|
|
javascriptEnabled: true,
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
plugins: [mars3dPlugin()],
|
|
|
},
|
|
|
});
|