Ai
1 Star 1 Fork 0

我走路带着风啊/wechatmsg_h5

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vite.config.ts 1.60 KB
一键复制 编辑 原始数据 按行查看 历史
// vite.config.ts
import { defineConfig } from 'vite'
import { resolve } from 'path'
import vue from '@vitejs/plugin-vue'
import { splitVendorChunkPlugin } from 'vite'
export default defineConfig({
//静态资源服务的文件夹
base: './',
resolve: {
// 别名
alias: {
'@': resolve(__dirname, 'src'),
}
},
css: {
// css预处理器
preprocessorOptions: {
less: {
modifyVars: {
// 全局less变量存储路径(配置less的全局变量)
hack: `true; @import (reference) "${resolve('src/public/config.less')}";`,
},
javascriptEnabled: true,
}
}
},
build: {
cssCodeSplit: true, //启用/禁用 CSS 代码拆分。当启用时,在异步 chunk 中导入的 CSS 将内联到异步 chunk 本身,并在其被加载时插入。
minify: "terser", //terser 构建后文件体积更小
chunkSizeWarningLimit: 1500, // 构建文件大小
},
plugins: [
vue(),
splitVendorChunkPlugin() //产物分块策略 //https://cn.vitejs.dev/guide/build.html#customizing-the-build
],
server: {
host: "0.0.0.0",
cors: false,//为开发服务器配置 CORS , 默认启用并允许任何源
port: 3000,
open: true, // 启动后自动打开浏览器
proxy: {
'/api': {
target: 'https://www.xxx.com/api',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
}
}
}
})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gsphelow/wechatmsg_h5.git
git@gitee.com:gsphelow/wechatmsg_h5.git
gsphelow
wechatmsg_h5
wechatmsg_h5
master

搜索帮助