Last active
October 16, 2023 18:43
-
-
Save antony/a01469ef144e63891579e1201d8e943d to your computer and use it in GitHub Desktop.
WASM dependency on Vercel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
VERCEL_OUTPUT_DIR=.vercel_build_output | |
LAMBDA_DIR=.vercel_build_output/functions/node/render/ | |
cp -r static $LAMBDA_DIR/static | |
cp node_modules/sharp/build/Release/*.node $LAMBDA_DIR | |
cp node_modules/canvas/build/Release/*.node $LAMBDA_DIR | |
cp node_modules/sharp/vendor/8.11.3/linux-x64/lib/libvips-cpp.so.42 $LAMBDA_DIR | |
cp ./images.json $VERCEL_OUTPUT_DIR | |
sed -i 's#\.\./build/Release#\.#g' $LAMBDA_DIR/index.js | |
echo "Moved production dependencies into their correct directories" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": { | |
"build": "svelte-kit build && sh ./fix-sharp.sh" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note that this is for Vercel Filesystem API v1/v2. For the new Build Output API v3 which builds into a dir called .vercel, you probably need to change that top variable name. You may need to modify other things, I've not upgraded this project yet.