Skip to content

Update vue-cli mode documentation to show a mode other than production or development #985

Closed
@richard-edwards

Description

@richard-edwards

What problem does this feature solve?

Increases comprehension on what the --mode feature can be used for and how it might be used, specifically that you can override the NODE_ENV variable to produce a production build with alternate config (ie. staging)

Refer to https://forum.vuejs.org/t/how-to-build-production-app-with-varying-config/29708/3

What does the proposed API look like?

.env
VUE_APP_TITLE=My App
.env.staging
NODE_ENV=production
VUE_APP_TITLE=My App (staging)
vue-cli-service build
  • builds a production app using .env then .env.production (or .env.production.local)
vue-cli-service build --mode staging
  • builds a production app using .env then .env.staging (or .env.staging.local)

In both cases, the app is built as a production app because of the NODE_ENV, but in the staging equivalent the process.env.VUE_APP_TITLE variable is overrided

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions