Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions packages/nextjs/vercel/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ commit (but not push) this change.

Go into your project settings on Vercel and change the install command to

`bash .sentry/install-sentry-from-branch.sh`.
`bash .sentry/install-sentry-from-branch.sh`

If you're using bundle analyzer, change the build command to
and the build command to

`yarn build && mv .next/analyze/* public`.
`yarn build && bash .sentry/post-app-build.sh`.

The bundle visualizations will be available on your deployed site at `/client.html` and `/server.html`.
If you're using bundle analyzer, the post-build script will move the visualizations it creates so that they're available
on your deployed site at `/client.html` and `/server.html`.

NOTE: You don't need to change the `@sentry/nextjs` dependency in your project's `package.json` file. That will happen
on the fly each time your app is deployed.
Expand Down
1 change: 1 addition & 0 deletions packages/nextjs/vercel/make-project-use-current-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ mkdir .sentry
echo " "
echo "Creating install scripts and committing the changes"
cp $NEXTJS_SDK_DIR/vercel/install-sentry-from-branch.sh .sentry
cp $NEXTJS_SDK_DIR/vercel/post-app-build.sh .sentry
echo "export BRANCH_NAME=${SDK_BRANCH_NAME}" >>.sentry/set-branch-name.sh
git add .
git commit -m "add scripts for using ${SDK_BRANCH_NAME} branch of @sentry/nextjs"
Expand Down
16 changes: 16 additions & 0 deletions packages/nextjs/vercel/post-app-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# SCRIPT TO INCLUDE AS PART OF A VERCEL-DEPLOYED PROJECT, FOR WORK TO BE DONE AFTER THE NEXTJS APP IS BUILT
# USE `yarn vercel:project <path-to-project>` TO HAVE IT AUTOMATICALLY ADDED TO YOUR PROJECT

# CUSTOM BUILD COMMAND FOR PROJECT ON VERCEL: `yarn build && bash .sentry/post-app-build.sh`

if [[ -e .next/analyze/ ]]; then
echo " "
echo "Moving bundle analysis graphs from \`.next/analyze/\` to \`/public\`"
mv .next/analyze/* public
fi
if [[ -e .next/server/analyze/ ]]; then
echo " "
echo "Moving bundle analysis graphs from \`.next/server/analyze/\` to \`/public\`"
mv .next/server/analyze/* public
echo " "
fi