vite.config.ts
@@ -16,7 +16,7 @@ // https://vitejs.dev/config/ export default defineConfig(({ command, mode }) => { // 添加第三个参数空字符串时 '' ,会在env中包含所有环境变量;反之,只包含.env文件中配置的环境变量 const env = loadEnv(command, process.cwd() + '/env') const env = loadEnv(mode, process.cwd() + '/env') // eslint-disable-next-line no-useless-escape return { plugins: [