代码拉取完成,页面将自动刷新
同步操作将从 金合科技/金合可视化平台 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import type { ConfigEnv } from 'vite'
import { loadEnv, defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ElementPlus from 'unplugin-element-plus/vite'
import plainText from 'vite-plugin-plain-text'
import setupExtend from 'vite-plugin-vue-setup-extend'
import components from 'unplugin-vue-components/vite'
import autoImport from 'unplugin-auto-import/vite'
import compression from 'vite-plugin-compression'
// import { mars3dPlugin } from 'vite-plugin-mars3d'
import { resolve } from 'path'
function pathResolve(dir: string) {
return resolve(process.cwd(), '.', dir)
}
// https://vitejs.dev/config/
export default ({ mode }: ConfigEnv) => {
const dirRoot = process.cwd()
const env = loadEnv(mode, dirRoot)
return defineConfig({
base: env.VITE_PUBLIC_PATH,
plugins: [
vue({
script: {
defineModel: true,
},
}),
ElementPlus(),
setupExtend(),
plainText(/\.hbs$/),
components({
dirs: ['src/components/ui/global-config/**', 'src/components/global/**', 'src/components/chart-config/**', 'src/components/other-config/**'],
extensions: ['vue', 'tsx'],
include: [/\.vue$/, /\.vue\?vue/, /\.tsx$/, /\.jsx$/],
dts: 'src/types/components.d.ts',
}),
autoImport({
imports: [
'vue',
],
dts: './src/types/auto-imports.d.ts',
dirs: [
'./src/components/chart-config/**',
'./src/components/other-config/**',
'./src/data/select/**',
'./src/hooks/**',
'./src/enum/**',
'./src/components/_models/**',
],
}),
compression({
// 可选配置项
algorithm: 'gzip', // 默认就是gzip压缩
ext: '.gz', // 压缩后文件扩展名,默认.gz
deleteOriginalAssets: false, // 是否删除未压缩的原始资源,默认false
threshold: 0, // 对超过多少字节以上的文件进行压缩,0表示所有文件都压缩
}),
// mars3dPlugin(),
],
server: {
host: '0.0.0.0',
port: 9096,
proxy: {
'/basic-api': {
target: env.VITE_PROXY_URL,
changeOrigin: true,
// ws: true,
rewrite: path => path.replace(new RegExp(`^/basic-api`), ''),
},
'/fileupload': {
target: env.VITE_UPLOAD_URL_PROXY,
changeOrigin: true,
ws: true,
rewrite: path => path.replace(new RegExp(`^/fileupload`), ''),
},
'/look': {
target: env.VITE_PROXY_URL,
changeOrigin: true,
ws: true,
rewrite: path => path.replace(new RegExp(`^/look`), ''),
},
},
},
resolve: {
alias: {
'@': pathResolve('./src'),
'vue-i18n': pathResolve('./node_modules/vue-i18n/dist/vue-i18n.cjs.js'),
},
},
define: {
// setting vue-i18-next
// Suppress warning
__INTLIFY_PROD_DEVTOOLS__: false,
__DEV__: process.env.NODE_ENV !== 'production',
__PROD__: process.env.NODE_ENV === 'production',
},
optimizeDeps: {
include: [
'@monaco-editor/loader',
'accounting',
'axios',
'crypto-js',
'dayjs',
'echarts',
'echarts-wordcloud',
'element-plus',
'gsap',
'html2canvas',
'js-cookie',
'lodash-es',
'monaco-editor',
'naive-ui',
'number-precision',
'particles.vue3',
'shortid',
'vue',
'vue-echarts',
'vue-i18n',
'vue-router',
],
exclude: [],
},
build: {
sourcemap: false,
outDir: 'website',
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html'),
share: resolve(__dirname, 'index.share.html'),
},
},
},
esbuild: {
},
})
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。