- 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
Common configs are located at configs/common.json
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
.
BROWSER=chrome npm run build
ENV=prod npm run build
BROWSER=chrome ENV=prod npm run build
- chrome
- edge
- firefox
- local
- beta
- prod