MCPcopy Create free account
hub / github.com/vercel/vercel / createExternalizer

Function createExternalizer

packages/python/test/dependency-externalizer.test.ts:54–74  ·  view source on GitHub ↗
({
      uvLockPath = '/path/to/uv.lock' as string | null,
      hasCustomCommand = false,
      totalBundleSize = 0,
    } = {})

Source from the content-addressed store, hash-verified

52 const ephemeralOversized = LAMBDA_EPHEMERAL_STORAGE_BYTES + 1;
53
54 function createExternalizer({
55 uvLockPath = '/path/to/uv.lock' as string | null,
56 hasCustomCommand = false,
57 totalBundleSize = 0,
58 } = {}) {
59 const ext = new PythonDependencyExternalizer({
60 venvPath: '/tmp/venv',
61 vendorDir: '_vendor',
62 workPath: '/tmp/work',
63 uvLockPath,
64 uvProjectDir: '/tmp/work',
65 projectName: 'test-project',
66 pythonMajor: 3,
67 pythonMinor: 12,
68 pythonPath: '/usr/bin/python3',
69 hasCustomCommand,
70 });
71 // Set the private totalBundleSize field for testing
72 (ext as any).totalBundleSize = totalBundleSize;
73 return ext;
74 }
75
76 it('returns true when bundle exceeds threshold and uvLockPath is present', () => {
77 delete process.env.VERCEL_SUPPORT_LARGE_FUNCTIONS;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected