feat: add convenience functions, update Docker setup, and integrate Webpack for building WebRTC internals exporter
Some checks failed
Build Docker Images for Pull Request / build (pull_request) Failing after 4m8s
Some checks failed
Build Docker Images for Pull Request / build (pull_request) Failing after 4m8s
This commit is contained in:
26
webrtc-internals-exporter/webpack/build.js
Normal file
26
webrtc-internals-exporter/webpack/build.js
Normal file
@@ -0,0 +1,26 @@
|
||||
const { execSync } = require('child_process');
|
||||
const args = process.argv.slice(2);
|
||||
|
||||
let url = '';
|
||||
|
||||
args.forEach((arg, index) => {
|
||||
if (arg === '-u' || arg === '--url') {
|
||||
url = args[index + 1];
|
||||
} else if (arg === '-h' || arg === '--help') {
|
||||
console.log('Usage: npm run build -- [-u|--url <url>]');
|
||||
console.log('Options:');
|
||||
console.log(' -u, --url <url> URL to use for the extension collector server');
|
||||
console.log(' -h, --help Display this help message');
|
||||
process.exit(0);
|
||||
} else if (arg.startsWith('-')) {
|
||||
console.error(`Unrecognized argument: ${arg}`);
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
if (url) {
|
||||
console.log(`Building with URL: ${url}`);
|
||||
execSync(`webpack --env URL=${url}`, { stdio: 'inherit' });
|
||||
} else {
|
||||
execSync('webpack', { stdio: 'inherit' });
|
||||
}
|
Reference in New Issue
Block a user