首页 > 解决方案 > 如何在类星体中构建具有不同环境的项目

问题描述

我正在使用 dotenv 扩展来设置不同的环境。如何使用暂存和生产配置构建项目?

{
  "@quasar/dotenv": {
    "env_development": ".env.development",
    "env_staging": ".env.staging",
    "env_production": ".env.production",
    "common_root_object": "none",
    "create_env_files": true,
    "add_env_to_gitignore": false
  }
}

我已经尝试过 quasar build -end staging。它有效吗?

标签: vue.jsquasar

解决方案


目前quasarframework/app-extension-dotenv有一个限制,它只支持ProductionDevelopment环境。

This app-extension can only handle 2 environments. If you need more environments, use the qenv app-extension.
https://github.com/quasarframework/app-extension-qenv

https://github.com/quasarframework/app-extension-dotenv/issues/21


推荐阅读