加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.ts 1.66 KB
一键复制 编辑 原始数据 按行查看 历史
木遥 提交于 2024-03-11 09:49 . 同步最新admin代码
import { defineApplicationConfig } from '@vben/vite-config';
import path, { resolve } from 'path';
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',
],
},
resolve: {
alias: [
{
find: /@mars\//,
replacement: pathResolve('src/marsgis') + '/',
},
],
},
define: {
'process.env': {
BASE_URL: '/',
},
},
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`), ''),
},
},
open: true, // 中文
warmup: {
clientFiles: ['./index.html', './src/{views,components}/*'],
},
},
css: {
preprocessorOptions: {
less: {
javascriptEnabled: true,
additionalData: `@import "${path.resolve(__dirname, "src/marsgis/components/mars-ui/base.less")}";`
}
}
},
plugins: [mars3dPlugin()],
},
});
function pathResolve(dir: string) {
return resolve(process.cwd(), '.', dir);
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化