53 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
			
		
		
	
	
			53 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
| import { defineConfig } from 'vite'
 | |
| import vue from '@vitejs/plugin-vue'
 | |
| import vitePluginImport from 'vite-plugin-babel-import';
 | |
| import path from 'path'
 | |
| import vueJsx from '@vitejs/plugin-vue-jsx'
 | |
| 
 | |
| const baseUrl = {
 | |
|   dev: './',
 | |
|   prod: './',
 | |
| }
 | |
| 
 | |
| // https://vitejs.dev/config/
 | |
| export default ({ mode,command }) => {
 | |
|   return defineConfig({
 | |
|     plugins: [vue(), vueJsx()],
 | |
| 
 | |
|     base: baseUrl[mode],
 | |
|     resolve: {
 | |
|       alias: {
 | |
|         "~": path.resolve(__dirname, "./"),
 | |
|         "@": path.resolve(__dirname, "src"),
 | |
|       },
 | |
|     },
 | |
|     compilerOptions: {
 | |
|       types: ["vite/client"],
 | |
|     },
 | |
|     esbuild: {
 | |
|       jsxFactory: "h",
 | |
|       jsxFragment: "Fragment",
 | |
|     },
 | |
|     server: {
 | |
|       host: '0.0.0.0',	// ← 新增内容 ←
 | |
|       port:"8099",
 | |
|       proxy: {
 | |
|         "/api": {
 | |
|           target: "http://backend-api-02.newbee.ltd/manage-api/v1",
 | |
|           changeOrigin: true,
 | |
|           rewrite: (path) => path.replace(/^\/api/, ""),
 | |
|         },
 | |
|       },
 | |
|     },
 | |
|     // //样式表插件
 | |
|     // css:{
 | |
|     //   postcss:{
 | |
|     //     plugins:[
 | |
|     //       postcssImport,
 | |
|     //       autoprefixer,
 | |
|     //     ]
 | |
|     //   }
 | |
|     // }
 | |
|   })
 | |
| }
 |