1234567891011121314151617181920 |
- import { defineConfig,loadEnv } from 'vite'
- import vue from '@vitejs/plugin-vue'
- import path from "path";
- // https://vitejs.dev/config/
- export default ({mode})=> defineConfig({
- base: loadEnv(mode,process.cwd()).VITE_APP_BASE_URL,// 若服务器不是将该项目放在根目录的则 需要此设置 和服务器上同名
- plugins: [vue()],
- server:{
- host:true
- },
- resolve: {
- alias: {
- "@": path.resolve(__dirname, "./src"),
- },
- },
- build:{
- outDir:loadEnv(mode, process.cwd()).VITE_APP_OUTDIR
- },
- })
|