创建时间: 2023-05-30 08:26:16更新时间: 2023-05-30 08:26:16#vite env 加载env 文件 默认情况下,开发服务器 (serve 命令) 运行在 development (开发)模式,而 build 命令运行在 production (生产)模式。 vite build --mode staging #package.json : "scripts": { "dev": "vite", "serve": "vite", "build:dev": "vue-tsc && vite build --mode development", "build:test": "vue-tsc && vite build --mode test", "build:pro": "vue-tsc && vite build --mode production", } #vite.config.js const env = loadEnv(mode, root);