Skip to content

Commit eb2cfbd

Browse files
authored
Allow sharp version override in build (#259)
Update build.ts to allow environment variable driven override of the sharp version, which fixes #243
1 parent 60fd292 commit eb2cfbd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/open-next/src/build.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,11 @@ function createImageOptimizationBundle() {
347347
// For SHARP_IGNORE_GLOBAL_LIBVIPS see: https://github.com/lovell/sharp/blob/main/docs/install.md#aws-lambda
348348

349349
const nodeOutputPath = path.resolve(outputPath);
350+
const sharpVersion = process.env.SHARP_VERSION ?? "0.32.5";
350351

351352
//check if we are running in Windows environment then set env variables accordingly.
352353
cp.execSync(
353-
`npm install --arch=arm64 --platform=linux --target=18 --libc=glibc --prefix="${nodeOutputPath}" sharp@0.32.5`,
354+
`npm install --arch=arm64 --platform=linux --target=18 --libc=glibc --prefix="${nodeOutputPath}" sharp@${sharpVersion}`,
354355
{
355356
stdio: "inherit",
356357
cwd: appPath,

0 commit comments

Comments
 (0)