1 Star 0 Fork 181

mgLuck/vue-naive-admin

forked from isme.top/vue-naive-admin 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.js 1.16 KB
一键复制 编辑 原始数据 按行查看 历史
zclzone 提交于 2022-08-27 14:09 . refactor: refactor
import { defineConfig, loadEnv } from 'vite'
import { convertEnv, getSrcPath, getRootPath } from './build/utils'
import { createViteProxy, viteDefine } from './build/config'
import { createVitePlugins } from './build/plugin'
import { OUTPUT_DIR } from './build/constant'
export default defineConfig(({ command, mode }) => {
const srcPath = getSrcPath()
const rootPath = getRootPath()
const isBuild = command === 'build'
const env = loadEnv(mode, process.cwd())
const viteEnv = convertEnv(env)
const { VITE_PORT, VITE_PUBLIC_PATH, VITE_USE_PROXY, VITE_PROXY_TYPE } = viteEnv
return {
base: VITE_PUBLIC_PATH || '/',
resolve: {
alias: {
'~': rootPath,
'@': srcPath,
},
},
define: viteDefine,
plugins: createVitePlugins(viteEnv, isBuild),
server: {
host: '0.0.0.0',
port: VITE_PORT,
open: false,
proxy: createViteProxy(VITE_USE_PROXY, VITE_PROXY_TYPE),
},
build: {
target: 'es2015',
outDir: OUTPUT_DIR,
reportCompressedSize: false, // 启用/禁用 gzip 压缩大小报告
chunkSizeWarningLimit: 1024, // chunk 大小警告的限制(单位kb)
},
}
})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mgluck/vue-naive-admin.git
git@gitee.com:mgluck/vue-naive-admin.git
mgluck
vue-naive-admin
vue-naive-admin
main

搜索帮助