Fix Domain Access Issue in Latest Vite Version (#1444)
Fix the restriction on using domain names when users are using the latest version of Vite When users use the new version of Vite, the UI cannot be accessed via domain names due to Vite's new rules. This fix adds the corresponding parameters according to Vite's new rules, ensuring that users can access the frontend via domain names when building the UI. Fixes #1441 Co-authored-by: WenjiaoYue <wenjiao.yue@intel.com>
This commit is contained in:
@@ -7,14 +7,7 @@ import type { UserConfig } from "vite";
|
|||||||
const config: UserConfig = {
|
const config: UserConfig = {
|
||||||
plugins: [sveltekit()],
|
plugins: [sveltekit()],
|
||||||
server: {
|
server: {
|
||||||
proxy: {
|
allowedHosts: true,
|
||||||
"/api": {
|
|
||||||
target: "http://10.112.228.168:8000",
|
|
||||||
changeOrigin: true,
|
|
||||||
secure: true,
|
|
||||||
rewrite: (path) => path.replace(/^\/api/, ""),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ import type { UserConfig } from "vite";
|
|||||||
|
|
||||||
const config: UserConfig = {
|
const config: UserConfig = {
|
||||||
plugins: [sveltekit()],
|
plugins: [sveltekit()],
|
||||||
|
server: {
|
||||||
|
allowedHosts: true,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default config;
|
export default config;
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ import type { UserConfig } from "vite";
|
|||||||
|
|
||||||
const config: UserConfig = {
|
const config: UserConfig = {
|
||||||
plugins: [sveltekit()],
|
plugins: [sveltekit()],
|
||||||
server: {},
|
server: {
|
||||||
|
allowedHosts: true,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default config;
|
export default config;
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ import type { UserConfig } from "vite";
|
|||||||
|
|
||||||
const config: UserConfig = {
|
const config: UserConfig = {
|
||||||
plugins: [sveltekit()],
|
plugins: [sveltekit()],
|
||||||
server: {},
|
server: {
|
||||||
|
allowedHosts: true,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default config;
|
export default config;
|
||||||
|
|||||||
@@ -17,4 +17,7 @@ import { defineConfig } from "vite";
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [sveltekit()],
|
plugins: [sveltekit()],
|
||||||
|
server: {
|
||||||
|
allowedHosts: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ import type { UserConfig } from "vite";
|
|||||||
|
|
||||||
const config: UserConfig = {
|
const config: UserConfig = {
|
||||||
plugins: [sveltekit()],
|
plugins: [sveltekit()],
|
||||||
server: {},
|
server: {
|
||||||
|
allowedHosts: true,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default config;
|
export default config;
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ import type { UserConfig } from "vite";
|
|||||||
|
|
||||||
const config: UserConfig = {
|
const config: UserConfig = {
|
||||||
plugins: [sveltekit()],
|
plugins: [sveltekit()],
|
||||||
server: {},
|
server: {
|
||||||
|
allowedHosts: true,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default config;
|
export default config;
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import type { UserConfig } from "vite";
|
|||||||
|
|
||||||
const config: UserConfig = {
|
const config: UserConfig = {
|
||||||
plugins: [sveltekit()],
|
plugins: [sveltekit()],
|
||||||
server: {},
|
server: {
|
||||||
|
allowedHosts: true,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default config;
|
export default config;
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ import type { UserConfig } from "vite";
|
|||||||
|
|
||||||
const config: UserConfig = {
|
const config: UserConfig = {
|
||||||
plugins: [sveltekit()],
|
plugins: [sveltekit()],
|
||||||
server: {},
|
server: {
|
||||||
|
allowedHosts: true,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default config;
|
export default config;
|
||||||
|
|||||||
@@ -18,8 +18,7 @@ import type { UserConfig } from "vite";
|
|||||||
const config: UserConfig = {
|
const config: UserConfig = {
|
||||||
plugins: [sveltekit()],
|
plugins: [sveltekit()],
|
||||||
server: {
|
server: {
|
||||||
host: "0.0.0.0",
|
allowedHosts: true,
|
||||||
port: 5173,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -17,4 +17,7 @@ import { defineConfig } from "vite";
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [sveltekit()],
|
plugins: [sveltekit()],
|
||||||
|
server: {
|
||||||
|
allowedHosts: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ import type { UserConfig } from "vite";
|
|||||||
|
|
||||||
const config: UserConfig = {
|
const config: UserConfig = {
|
||||||
plugins: [sveltekit()],
|
plugins: [sveltekit()],
|
||||||
server: {},
|
server: {
|
||||||
|
allowedHosts: true,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default config;
|
export default config;
|
||||||
|
|||||||
Reference in New Issue
Block a user