given files
This commit is contained in:
parent
9bf88844e9
commit
a2c31f873d
48 changed files with 10458 additions and 0 deletions
44
vite.config.js
Normal file
44
vite.config.js
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import { resolve } from "path";
|
||||
import { defineConfig, loadEnv } from "vite";
|
||||
import dns from "dns";
|
||||
|
||||
dns.setDefaultResultOrder("verbatim");
|
||||
const root = resolve(__dirname, "src/pages/");
|
||||
|
||||
export default ({ mode }) => {
|
||||
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) };
|
||||
|
||||
return defineConfig({
|
||||
root,
|
||||
server: {
|
||||
host: process.env.VITE_HOST,
|
||||
port: process.env.VITE_PORT,
|
||||
proxy: {
|
||||
// $VITE_URL/api* -> $VITE_API_URL/api*
|
||||
"/api": {
|
||||
target: process.env.VITE_API_URL,
|
||||
changeOrigin: true,
|
||||
},
|
||||
// $VITE_URL/socket.io* -> $VITE_API_URL/socket.io*
|
||||
"/socket.io": {
|
||||
target: process.env.VITE_API_URL,
|
||||
changeOrigin: true,
|
||||
ws: true,
|
||||
},
|
||||
// $VITE_URL/auth-api* -> $VITE_AUTH_URL*
|
||||
"/auth-api": {
|
||||
target: process.env.VITE_AUTH_URL,
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
rewrite: (path) => path.replace(/^\/auth-api/, ""),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
publicDir: resolve(__dirname, "public"),
|
||||
assetsInclude: [
|
||||
"src/components/**/*.html",
|
||||
"src/pages/debug/debug.html",
|
||||
],
|
||||
});
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue