3 Star 4 Fork 0

Go application / im-client-web

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vite.config.ts 1.63 KB
一键复制 编辑 原始数据 按行查看 历史
chendong 提交于 2022-10-20 10:45 . feat: 群聊功能完成,打包优化
import { defineConfig, loadEnv } from 'vite'
import { resolve } from 'path'
import vue from '@vitejs/plugin-vue'
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, __dirname)
return {
plugins: [
vue(),
createSvgIconsPlugin({
// 指定要缓存的文件夹
iconDirs: [resolve(process.cwd(), 'src/assets/svg/icons')],
// 指定symbolId格式
symbolId: 'icon-[name]',
}),
],
resolve: {
alias: {
'@': resolve(__dirname, './src'),
},
},
server: {
port: 3000,
open: false,
https: false,
cors: true,
proxy: {
'/api': {
secure: false,
// ws: true,
target: env.VITE_APP_BASE_API,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},
},
},
build: {
chunkSizeWarningLimit: 1500,
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
return id
.toString()
.split('node_modules/')[1]
.split('/')[0]
.toString()
}
},
chunkFileNames: (chunkInfo) => {
const facadeModuleId = chunkInfo.facadeModuleId
? chunkInfo.facadeModuleId.split('/')
: []
const fileName =
facadeModuleId[facadeModuleId.length - 2] || '[name]'
return `js/${fileName}/[name].[hash].js`
},
},
},
},
}
})
1
https://gitee.com/go-im/im-client-web.git
git@gitee.com:go-im/im-client-web.git
go-im
im-client-web
im-client-web
master

搜索帮助