Skip to content

Instantly share code, notes, and snippets.

@acidsound
Created May 14, 2022 06:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acidsound/b68f69e291d852cdb550a2b5ecebaddb to your computer and use it in GitHub Desktop.
Save acidsound/b68f69e291d852cdb550a2b5ecebaddb to your computer and use it in GitHub Desktop.
Upload sourceMap to Honeybadger.io using vite
npx vite build --outDir build
find ./build/assets -name "*.js" -print0 | while read -d $'\0' file
do
curl https://api.honeybadger.io/v1/source_maps \
-F api_key=$VITE_HONEYBADGER \
-F minified_url=$VITE_APP_BUILD/$(echo $file | sed -e 's/\.\/build\///g') \
-F source_map=@$file.map \
-F minified_file=@$file \;
# echo "$VITE_APP_ENDPOINT/$file" | sed -e 's/\.\/build\///g'
done
rm build/assets/*.map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment