| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- import { defineConfig } from 'vite'
- import vue from '@vitejs/plugin-vue'
- import Components from 'unplugin-vue-components/vite'
- import { VantResolver } from 'unplugin-vue-components/resolvers'
- import path from 'path'
- import basicSSL from '@vitejs/plugin-basic-ssl'
- // https://vitejs.dev/config/
- export default defineConfig({
- base: '/wap/',
- plugins: [
- basicSSL(),
- vue(),
- Components({
- resolvers: [VantResolver()]
- })
- ],
- resolve: {
- alias: {
- "@": path.resolve(__dirname, './src')
- }
- },
- server: {
- https: true,
- host: '0.0.0.0',
- port: 5173,
- open: true,
- proxy: {
- '/forward-service': {
- // target: 'http://192.168.103.33:8585/',
- // target: 'http://192.168.104.74:8585/',// 测试环境
- target: 'https://iot.tuoren.com/forward-service', // 生产环境
- changeOrigin: true,
- rewrite: (path) => {
- // console.log('path', path)
- return path.replace(/^\/forward-service/, '')
- }
- }
- }
- }
- })
|