Skip to content

Define ENV variables in .ember-cli #7896

@gossi

Description

@gossi

It can become tedious to prefix every command with the correct environment variables over and over again. At the moment for example if you have an experiment running, you have to prefix the ember command with that experiment name, e.g. EMBER_CLI_MODULE_UNIFICATION=true ember serve.

As those ENV variables depend on their project, it makes most sense to define them once for that project and use ember commands as usual. .ember-cli looks like a good place for me to define them and could look like this:

{
  "disableAnalytics": false,
  "EMBER_CLI_MODULE_UNIFICATION": true
};

or be more explicit:

{
  "disableAnalytics": false,
  "ENV": {
    "EMBER_CLI_MODULE_UNIFICATION": true
  }
};

Alternatively read in a .env file(s) where variables can be defined. There is kind of a standard here I guess? Which is used by CI/CD services. I haven't run enough research on this one to make a clear statement other than "more research needed".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions