We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7745576 commit b841e8fCopy full SHA for b841e8f
vite.config.ts
@@ -8,6 +8,7 @@ import { proxy } from './config/vite/proxy';
8
export default ({ command, mode }) => {
9
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) };
10
const isBuild = command === 'build';
11
+ const env = process.env.VITE_APP_ENV ? process.env.VITE_APP_ENV : 'development';
12
return defineConfig({
13
plugins: createVitePlugins(isBuild),
14
resolve: {
@@ -44,7 +45,7 @@ export default ({ command, mode }) => {
44
45
open: false, // 类型: boolean | string在服务器启动时自动在浏览器中打开应用程序;
46
cors: false, // 类型: boolean | CorsOptions 为开发服务器配置 CORS。默认启用并允许任何源
47
host: '0.0.0.0', // IP配置,支持从IP启动
- proxy: proxy[process.env.VITE_APP_ENV ?? 'development'],
48
+ proxy: proxy[env],
49
},
50
});
51
};
0 commit comments