feat: init doc monitor (#3320)

This commit is contained in:
Alex Yang
2023-07-20 10:44:50 +08:00
committed by GitHub
parent 27edd7cd93
commit 604b53d9a4
20 changed files with 145 additions and 76 deletions

View File

@@ -21,8 +21,23 @@ const getChannel = () => {
}
};
const getDistribution = () => {
switch (process.env.DISTRIBUTION) {
case 'browser':
case 'desktop':
return process.env.DISTRIBUTION;
case undefined: {
console.log('DISTRIBUTION is not set, defaulting to browser');
return 'browser';
}
default: {
throw new Error('DISTRIBUTION must be one of browser, desktop');
}
}
};
const flags = {
distribution: 'browser',
distribution: getDistribution(),
mode: 'production',
channel: getChannel(),
coverage: process.env.COVERAGE === 'true',