Skip to content
This repository has been archived by the owner on Feb 1, 2025. It is now read-only.

Commit

Permalink
ref: allow for default handler use (#11)
Browse files Browse the repository at this point in the history
Co-authored-by: Jan Soukup <soukup@u.plus>
  • Loading branch information
sladg and sladg authored Aug 22, 2022
1 parent e841f0a commit ee93b03
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scripts/pack-nextjs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ set -e

# Current root for reference.
MY_ROOT=$(pwd)
SCRIPT_PATH="$(
cd -- "$(dirname "$0")" >/dev/null 2>&1
pwd -P
)"

# Folder where zip files will be outputed for CDK to pickup.
OUTPUT_PATH=next.out
Expand All @@ -26,13 +30,21 @@ NEXT_CONFIG=
GREP_BY=webpack

echo "My root is: $MY_ROOT"
echo "My script path is: $SCRIPT_PATH"

echo "Cleaning possible left-overs."
rm -rf $MY_ROOT/$OUTPUT_PATH

echo "Creating output folder."
mkdir -p $MY_ROOT/$OUTPUT_PATH

if [[ -f "$HANDLER_PATH" ]]; then
echo "Custom server handler found!"
else
echo "Using default server handler."
HANDLER_PATH=$SCRIPT_PATH/../dist/server-handler/index.js
fi

#
# -------------------------- Create deps layer --------------------------
echo "Creating dependencies layer."
Expand Down

0 comments on commit ee93b03

Please sign in to comment.