Refine pnpm migration based on review feedback

• Replace SKIP_SHARP_FILTERING with SHARP_IGNORE_GLOBAL_LIBVIPS environment variable
• Improve Sharp package filtering to include specific Linux architectures for Docker builds
• Optimize Dockerfile dependency caching with improved layer structure
• Clean up workspace configuration and remove redundant settings
This commit is contained in:
midzelis
2025-08-08 12:03:40 +00:00
parent 0992d50699
commit 0bfc8beec1
10 changed files with 118 additions and 72 deletions
+10 -1
View File
@@ -3,6 +3,7 @@ module.exports = {
readPackage: (pkg) => {
if (pkg.name && pkg.name === "exiftool-vendored") {
if (pkg.optionalDependencies["exiftool-vendored.pl"]) {
// make exiftool-vendored.pl a regular dependency
pkg.dependencies["exiftool-vendored.pl"] =
pkg.optionalDependencies["exiftool-vendored.pl"];
delete pkg.optionalDependencies["exiftool-vendored.pl"];
@@ -13,7 +14,15 @@ module.exports = {
(dep) => dep.startsWith("@img")
);
for (const dep of optionalDeps) {
if (dep.includes("musl") || process.env.SKIP_SHARP_FILTERING) {
// remove all optionalDepdencies from sharp (they will be compiled from source), except:
// include the precompiled musl version of sharp, for web/Dockerfile
// include precompiled linux-x64 version of sharp, for server/Dockerfile, stage: web-prod
// include precompiled linux-arm64 version of sharp, for server/Dockerfile, stage: web-prod
if (
dep.includes("musl") ||
dep.includes("linux-x64") ||
dep.includes("linux-arm64")
) {
continue;
}
delete pkg.optionalDependencies[dep];