回退多余的配置

dev
suixy 2 months ago
parent b9de90424d
commit 9530bee1de

@ -1,5 +1,4 @@
import { defineConfig, loadEnv } from 'vite'; import { defineConfig, loadEnv } from 'vite';
import basicSsl from '@vitejs/plugin-basic-ssl';
import createPlugins from './vite/plugins'; import createPlugins from './vite/plugins';
import autoprefixer from 'autoprefixer'; // css自动添加兼容性前缀 import autoprefixer from 'autoprefixer'; // css自动添加兼容性前缀
import path from 'path'; import path from 'path';
@ -18,18 +17,16 @@ export default defineConfig(({ mode, command }) => {
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'] extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
}, },
// https://cn.vitejs.dev/config/#resolve-extensions // https://cn.vitejs.dev/config/#resolve-extensions
plugins: [createPlugins(env, command === 'build'), basicSsl()], plugins: createPlugins(env, command === 'build'),
server: { server: {
host: '0.0.0.0', host: '0.0.0.0',
https: true,
port: Number(env.VITE_APP_PORT), port: Number(env.VITE_APP_PORT),
open: true, open: true,
proxy: { proxy: {
[env.VITE_APP_BASE_API]: { [env.VITE_APP_BASE_API]: {
target: 'https://frp-off.com:47543', target: 'http://localhost:8080',
changeOrigin: true, changeOrigin: true,
ws: true, ws: true,
secure: false,
rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '') rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')
} }
} }

Loading…
Cancel
Save