You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{UserConfig,defineConfig,loadEnv}from'vite'importreactfrom'@vitejs/plugin-react-swc'importtsconfigPathsfrom'vite-tsconfig-paths'// https://vitejs.dev/config/exportdefaultdefineConfig(({ command, mode })=>{// Load env file based on `mode` in the current working directory.// Set the third parameter to '' to load all env regardless of the `VITE_` prefix.constenv=loadEnv(mode,process.cwd(),'')consthost: UserConfig['server']['host']=(()=>{if(!('NODE_ENV'inenv)){returnundefined}if(['production','development'].includes(env.NODE_ENV)){return'0.0.0.0'}returnundefined})()constvitePort: UserConfig['server']['port']=(()=>{if(!('VITE_PORT'inenv)){returnundefined}constport=Number(env.VITE_PORT)if(Number.isNaN(port)){returnundefined}returnport})()return{define: {__APP_ENV__: JSON.stringify(env.APP_ENV),},plugins: [react(),tsconfigPaths({root: './../',}),],server: {host: host,port: vitePort,},}})
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I got a question posted on stackoverflow
Please read it and see question.
I also provide vite.config.ts
package.json
tsconfigs
root:
at ./.configs/
tsconfig.node.json at ./.configs/
How I can proxy_pass to vite's dev server with nginx?
Beta Was this translation helpful? Give feedback.
All reactions