mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-10 04:22:12 +00:00
This PR fixes an issue where old versions of the CLI would update to the latest builder, but not have a copy of `@vercel/build-utils` because they only shipped with `@now/build-utils`. So in this case, we can fallback to the other package. We must be careful to only import types from `@vercel/build-utils` and anything needed at runtime must be imported from `./build-utils` wrapper.
11 lines
233 B
TypeScript
11 lines
233 B
TypeScript
let buildUtils: typeof import('@vercel/build-utils');
|
|
|
|
try {
|
|
buildUtils = require('@vercel/build-utils');
|
|
} catch (e) {
|
|
// Fallback for older CLI versions
|
|
buildUtils = require('@now/build-utils');
|
|
}
|
|
|
|
export default buildUtils;
|