| | |
| | | import {fileURLToPath, URL} from 'node:url' |
| | | |
| | | import {defineConfig} from 'vite' |
| | | import vue from '@vitejs/plugin-vue' |
| | | import ReactivityTransform from '@vue-macros/reactivity-transform/vite' |
| | | import AutoImport from 'unplugin-auto-import/vite' |
| | | |
| | | // https://vitejs.dev/config/ |
| | | export default defineConfig({ |
| | | plugins: [ |
| | | vue(), |
| | | ReactivityTransform() |
| | | ReactivityTransform(), |
| | | AutoImport({ |
| | | imports: [ |
| | | 'vue-i18n', |
| | | ], |
| | | dts: './auto-imports.d.ts', |
| | | eslintrc: { |
| | | enabled: false, // 配置更新时临时设为true, |
| | | }, |
| | | }), |
| | | ], |
| | | resolve: { |
| | | alias: { |
| | | 'vue-i18n': 'vue-i18n/dist/vue-i18n.cjs.js', |
| | | '@': fileURLToPath(new URL('./src', import.meta.url)) |
| | | } |
| | | }, |
| | |
| | | https: false, |
| | | proxy: { |
| | | '/api': { |
| | | target: 'http://localhost:8080/mesModuleTools', |
| | | target: 'http://127.0.0.1:88/', |
| | | changeOrigin: true, |
| | | rewrite: (path) => path.replace(/^\/api/, '/'), |
| | | }, |
| | | '/api2': { |
| | | target: 'http://localhost:8085/mesModuleTools', |
| | | changeOrigin: true, |
| | | pathRewrite: { |
| | | '^/api2': '', |
| | | }, |
| | | }, |
| | | // '/api2': { |
| | | // target: 'http://localhost:8085/mesModuleTools', |
| | | // changeOrigin: true, |
| | | // pathRewrite: { |
| | | // '^/api2': '', |
| | | // }, |
| | | // }, |
| | | }, |
| | | }, |
| | | configureServer: ({ middlewares }) => { |
| | |
| | | }) |
| | | ); |
| | | }, |
| | | }); |
| | | }); |