vue3+vite+多环境发面到二级目录配置
//vite.config.js
import {defineConfig, loadEnv} from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vite.dev/config/
export default defineConfig(({mode}) => {
const env = loadEnv(mode, process.cwd(), '');
let baseDir = env.VITE_BASE_PATH;
console.log('mode:' + mode + ', baseDir:' + baseDir);
return {
base: baseDir,
plugins: [vue()],
server: {
host: '0.0.0.0'
},
}
});
//.env.test VITE_BASE_URL=https://test.xxxx.run/api/ VITE_BASE_PATH=/h5/
============ 欢迎各位老板打赏~ ===========
与本文相关的文章
- · html5预览PDF(vue3)
- · vue3 html2canvas导出透明png图片
- · nginx http转https, 不带www转带www
- · nginx主动健康检查负载均衡模块
- · nginx自动切换到手机/PC 网站
- · vue/react/node/vite/npm/yarn build自动更新版本号
- · 使用tengine代替Nginx
- · nginx添加nginx_upstream_check_module
- · nginx上传文件超出默认大小限制,提示:413 Request Entity Too Large
- · vue3+vite3实现路由自动化
- · nginx反向代理禁用缓存
- · vue3无法使用vue-devtools
