代码拉取完成,页面将自动刷新
import { defineConfig } from 'vite';
import path from 'path';
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
import Icons from 'unplugin-icons/vite';
import { FileSystemIconLoader } from 'unplugin-icons/loaders';
import AutoImport from 'unplugin-auto-import/vite';
import Components from 'unplugin-vue-components/vite';
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
import ElementPlus from 'unplugin-element-plus/vite';
export default defineConfig({
base: process.env.NODE_ENV === 'development' ? './' : '/',
resolve: {
alias: {
'@/': `${path.resolve(__dirname, './src')}/`,
'vue-i18n': 'vue-i18n/dist/vue-i18n.cjs.js',
},
},
plugins: [
vue(),
vueJsx({}),
AutoImport({
resolvers: [ElementPlusResolver({ importStyle: 'sass' })],
}),
Components({
resolvers: [ElementPlusResolver({ importStyle: 'sass' })],
}),
Icons({
compiler: 'vue3',
customCollections: {
app: FileSystemIconLoader('./src/assets/svg-icons'),
},
}),
ElementPlus({
useSource: true,
}),
],
css: {
preprocessorOptions: {
scss: {
additionalData: `@use "@/shared/styles/element-plus/index.scss" as *;`,
},
},
},
build: {
chunkSizeWarningLimit: 1500,
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
return id
.toString()
.split('node_modules/')[1]
.split('/')[0]
.toString();
}
},
},
},
},
server: {
proxy: {
'/api-dsapi/': {
target: 'https://dsapi.osinfra.cn/',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api-dsapi/, ''),
},
'/api-omapi/': {
target: 'https://omapi.osinfra.cn/',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api-omapi/, ''),
},
'/api-issues/': {
target: 'https://quickissue-ipb-opengauss.test.osinfra.cn',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api-issues/, ''),
},
},
},
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。