1 Star 0 Fork 45

wmiboy/快验网络验证系统前端

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
vite.config.ts 2.12 KB
Copy Edit Raw Blame History
暗月隐落 authored 2023-07-29 22:12 . 开始处理一级代理添加
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
//element plus 使用的按需导入
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
// https://vitejs.dev/config/
export default defineConfig({
base: '/Admin/',
resolve:{
alias:{
'@': path.resolve(__dirname, 'src'),
'@/*': path.resolve(__dirname, 'src/*'),
'com': path.resolve(__dirname, 'src/components') // tsconfig.json 里也必须配置路径别名
}
},
build: {
outDir:'E:\\yun\\xuhaonan\\project\\TY通用后台管理系统\\server2\\core\\dist\\VueAdmin',
minify: "terser",
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true
}
}
},
css: {
//css预处理
preprocessorOptions: {
scss: {
/* 引入全局预定义变量 需要设置 lang="scss" */
additionalData: `@import "./src/styles/variables.scss";`,
}
}
},
plugins: [
vue(),
AutoImport({
resolvers: [ElementPlusResolver()],
}),
Components({
resolvers: [ElementPlusResolver()],
}),
],
server: {
hmr: { overlay: false }, // 禁用或配置 HMR 连接 设置 server.hmr.overlay 为 false 可以禁用服务器错误遮罩层
// 服务配置
port: 18080, // 类型: number 指定服务器端口;
open: false, // 类型: boolean | string在服务器启动时自动在浏览器中打开应用程序;
cors: true, // 类型: boolean | CorsOptions 为开发服务器配置 CORS。默认启用并允许任何源
//proxy look for https://vitejs.cn/config/#server-proxy
proxy: {
'/dev': {
target: 'http://127.0.0.1:18888',
changeOrigin: true,
rewrite: path => path.replace(/^\/dev/, '')
}
}
}
})
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wmiboy/KuaiYanWeb.git
git@gitee.com:wmiboy/KuaiYanWeb.git
wmiboy
KuaiYanWeb
快验网络验证系统前端
码云快验web

Search