将vite.config.ts中的base 改到插件 nacos-federation中实现,简化代码
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
# 请求协议 http or https(建议线上配置证书后,使用https)
|
||||
VITE_PREFIX=http://
|
||||
|
||||
# Nacos 配置中心ip:端口
|
||||
VITE_NACOS_ADDRESS=192.168.31.101:8848
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# 请求协议 http or https(建议线上配置证书后,使用https)
|
||||
VITE_PREFIX=http://
|
||||
|
||||
# Nacos 配置中心ip:端口
|
||||
VITE_NACOS_ADDRESS=192.168.31.101:8848
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ export default defineConfig(async ({ mode }): Promise<UserConfig> => {
|
||||
const env = loadEnv(mode, process.cwd());
|
||||
|
||||
return {
|
||||
base: `http://${ env.VITE_TRAEFIK_ADDRESS }/${ env.VITE_SERVER_NAME }/`,
|
||||
server: {
|
||||
port: Number(env.VITE_SERVER_PORT),
|
||||
host: '0.0.0.0',
|
||||
|
||||
Reference in New Issue
Block a user