Skip to content

Latest commit

 

History

History
52 lines (34 loc) · 1.2 KB

README.md

File metadata and controls

52 lines (34 loc) · 1.2 KB

Manage Configurations

Adding a new configuration

  • Under configs directory, add a directory with name as config key
  • For each possible value, add a JSON file under the directory
  • Each config JSON file should specify config properties (key-value pairs)
  • Set default in configs/defaults.json

Adding common/generic configuration

Common configs are located at configs/common.json

Generating configuration file

At project root, run npm run build.

It will generate a file config.js in dist directory. A temporary file config.build.json is also created inside dist directory. To add custom configs for local testing, directly edit dist/config.build.json file.

In MV2, include config.js in any module which needs it and access as RQ.configs.configKey. For instance, to access current environment, read RQ.configs.env.

Updating browser in config

BROWSER=chrome npm run build

Updating environment in config

ENV=prod npm run build

Updating both browser and environment in config

BROWSER=chrome ENV=prod npm run build

Possible values of BROWSER

  1. chrome
  2. edge
  3. firefox

Possible values of ENV

  1. local
  2. beta
  3. prod