Skip to content

ref(nextjs): Use new build process in vercel script #5065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 10, 2022
Merged
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
11 changes: 3 additions & 8 deletions packages/nextjs/vercel/install-sentry-from-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,8 @@ yarn --prod false

echo " "
echo "BUILDING SDK"
# Types are required for any type of build to succeed
yarn build:types
# We need to build es5 versions because `next.config.js` calls `require` on the SDK (to get `withSentryConfig`) and
# therefore it looks for `cjs/index.js`
yarn build:cjs
# We need to build esm versions because that's what `next` actually uses when it builds the app
yarn build:esm
# build types, cjs, and esm
yarn build:dev

# Set all packages in the repo to point to their siblings as file dependencies. That way, when we install the local copy
# of @sentry/nextjs, it'll pull the local copy of each of its @sentry/* dependents. This mimics what Lerna does with
Expand All @@ -53,7 +48,7 @@ PACKAGE_NAMES=$(ls $PACKAGES_DIR)
for package in ${PACKAGE_NAMES[@]}; do
# Within a given package.json file, search for each of the other packages in turn, and if found, make the replacement
for package_dep in ${PACKAGE_NAMES[@]}; do
sed -Ei /"@sentry\/${package_dep}"/s/"[0-9]+\.[0-9]+\.[0-9]+"/"file:${ESCAPED_PACKAGES_DIR}\/${package_dep}"/ ${PACKAGES_DIR}/${package}/package.json
sed -Ei /"@sentry\/${package_dep}"/s/"[0-9]+\.[0-9]+\.[0-9]+(-(alpha|beta)\.[0-9]+)?"/"file:${ESCAPED_PACKAGES_DIR}\/${package_dep}"/ ${PACKAGES_DIR}/${package}/package.json
done
done

Expand Down