forked from vercel/vercel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpkg.js
More file actions
27 lines (22 loc) · 788 Bytes
/
Copy pathpkg.js
File metadata and controls
27 lines (22 loc) · 788 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
26
27
#!/usr/bin/env node
import { basename } from 'node:path';
const [, , script] = process.argv;
process.env.VERCEL_VC_NATIVE = '1';
const defaultWarningListeners = process.listeners('warning');
process.removeAllListeners('warning');
process.on('warning', warning => {
if (warning.name === 'DeprecationWarning' && warning.code === 'DEP0169') {
return;
}
for (const listener of defaultWarningListeners) {
listener(warning);
}
});
// In the standalone binary, process.execPath points back to this binary.
// Route internal worker invocations here so script paths are not parsed as CLI args.
if (script && basename(script) === 'get-latest-worker.cjs') {
process.argv.splice(2, 1);
await import('./dist/get-latest-worker.cjs');
} else {
await import('./dist/vc.js');
}