123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- import {
- fileURLToPath,
- URL
- } from 'node:url'
- import {
- defineConfig
- } from 'vite'
- import vue from '@vitejs/plugin-vue'
- import AutoImport from 'unplugin-auto-import/vite';
- // https://vitejs.dev/config/
- export default defineConfig({
- plugins: [
- vue(),
- // 配置插件
- AutoImport({
- imports: ['vue', 'vue-router']
- })
- ],
- resolve: {
- alias: {
- '@': fileURLToPath(new URL('./src',
- import.meta.url))
- }
- },
- server: {
- host: true,
- open: true,
- // host: '192.168.11.102',
- port: '9999',
- proxy: {
- ['/prod-api']: {
- // target: 'http://120.26.86.247:9898/',//实际请求地址
- // target: 'http://47.122.47.140:9898/',//实际请求地址
- target: 'http://haijiacheng.com:80/prod-api', //实际请求地址
- changeOrigin: true,
- // ws: true,// websocket支持
- rewrite: (path) => path.replace('/prod-api', '') //替换实际请求后台地址
- }
- },
- https: false
- }
- })
|