Files
peertube-collector/webrtc-internals-exporter/webpack/build.js
Mirko Milovanovic d5e88732f9
All checks were successful
Build Docker Images for Pull Request / build (pull_request) Successful in 15m20s
feat: add convenience functions, update Docker setup, and integrate Webpack for building WebRTC internals exporter
2025-02-20 11:16:18 +01:00

26 lines
838 B
JavaScript

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' });
}