Skip to content

Commit 7db0922

Browse files
committed
Fix sharp node_module for esbuild
1 parent c91c1ba commit 7db0922

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

source/constructs/lib/back-end/back-end-construct.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,17 @@ export class BackEnd extends Construct {
110110
bundling: {
111111
externalModules: ["sharp"],
112112
nodeModules: ["sharp"],
113+
commandHooks: {
114+
beforeBundling(inputDir: string, outputDir: string): string[] {
115+
return [];
116+
},
117+
beforeInstall(inputDir: string, outputDir: string): string[] {
118+
return [];
119+
},
120+
afterBundling(inputDir: string, outputDir: string): string[] {
121+
return [`cd ${outputDir}`, "rm -rf node_modules/sharp && npm install --arch=x64 --platform=linux sharp"];
122+
},
123+
},
113124
},
114125
});
115126

0 commit comments

Comments
 (0)