| 12345678910111213141516171819202122232425262728293031323334 |
- import { defineConfig } from 'vite'
- import vue from '@vitejs/plugin-vue'
- import path from 'path';
- import legacy from '@vitejs/plugin-legacy'
- export default defineConfig({
- plugins: [
- vue(),
- legacy({
- targets: ['ie >= 8'],
- additionalLegacyPolyfills: ['regenerator-runtime/runtime']
- })
- ],
- resolve: {
- alias: {
- '@': path.resolve(__dirname, './src')
- }
- },
- server: {
- host: '0.0.0.0',
- port: 3300,
- proxy: {
- '/forward-service': {
- target: 'https://iot.tuoren.com/forward-service', // 生产环境
- // target: 'http://192.168.100.249:8585', // 测试环境
- changeOrigin: true,
- rewrite: (path) => {
- // console.log('path', path)
- return path.replace(/^\/forward-service/, '')
- }
- }
- }
- }
- })
|