| | |
| | | // https://vitejs.dev/config/ |
| | | export default defineConfig(({mode, command}) => { |
| | | let env = loadEnv(mode, process.cwd(), '') |
| | | console.log('-------'); |
| | | console.log(env.VITE_BASE_PATH); |
| | | console.log(env.VITE_BASE_PATH.replace(env.VITE_BASE_PATH, '')); |
| | | console.log('-------'); |
| | | // console.log('-------'); |
| | | // console.log(env.VITE_BASE_PATH); |
| | | // console.log(env.VITE_BASE_PATH.replace(env.VITE_BASE_PATH, '')); |
| | | // console.log('-------'); |
| | | return { |
| | | base:env.VITE_BASE_CONTEXT, |
| | | plugins: [ |
| | |
| | | |
| | | // 本地运行配置,及反向代理配置 |
| | | server: { |
| | | host: '192.168.0.3', |
| | | port: '8080', |
| | | cors: true, // 默认启用并允许任何源 |
| | | open: true, // 在服务器启动时自动在浏览器中打开应用程序 |
| | | //反向代理配置,注意rewrite写法,开始没看文档在这里踩了坑 |