forked from firefox-devtools/debugger
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetConfig.js
More file actions
25 lines (19 loc) · 747 Bytes
/
getConfig.js
File metadata and controls
25 lines (19 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const merge = require("lodash/merge");
const fs = require("fs");
const path = require("path");
function getConfig() {
const applicationConfig = require("../configs/application.json");
const firefoxConfig = require("../configs/firefox-panel.json");
const developmentConfig = require("../configs/development.json");
let localConfig = {};
if (fs.existsSync(path.resolve(__dirname, "../configs/local.json"))) {
localConfig = require("../configs/local.json");
}
if (process.env.TARGET === "firefox-panel") {
return firefoxConfig;
}
const envConfig = process.env.TARGET === "application" ?
applicationConfig : developmentConfig;
return merge({}, envConfig, localConfig);
}
module.exports = getConfig;