Skip to content

Environment ​

Vue-Launchpad uses standard Vite .env files for runtime differences and adds VITE_USER_NODE_ENV as a business-readable environment enum.

Env Files ​

FilePurpose
.env.exampleShared configuration sample committed for the team.
.env.developmentDefault local development configuration.
.env.stagingStaging/test build configuration.
.env.productionProduction build configuration.
.env.development.localLocal private overrides, usually not committed.

Core Variables ​

VariableDescription
VITE_USER_NODE_ENVBusiness environment label, such as development, staging, or production.
VITE_APP_BASE_APIAPI base path consumed by the Axios request layer.
VITE_PROXY_APIDevelopment proxy target mapped to /api.

Dynamic Proxy Rules ​

Every VITE_PROXY_XXX variable is converted into a proxy prefix:

Env VariableProxy Prefix
VITE_PROXY_API/api
VITE_PROXY_AUTH_SERVICE/auth-service
VITE_PROXY_ORDER_CENTER/order-center

Production does not generate local proxy rules. The frontend calls the real gateway defined by VITE_APP_BASE_API.

Custom Overrides ​

To override proxy details, copy proxy.custom.example.ts to proxy.custom.ts. Same-prefix options are deeply merged with generated rules, and custom fields take priority.

ts
import type { LaunchpadProxyOverrides } from "./build/proxy";

export default {
  "/api": {
    target: "http://localhost:9000",
  },
} satisfies LaunchpadProxyOverrides;