-
Notifications
You must be signed in to change notification settings - Fork 48
Add support for Next basePath
#416
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
Comments
Please, prioritize higher. |
in case it unblocks anyone – haven't fully tested it but seems like a very fragile and temporary post-build workaround like the following makes it work OK both locally built and deployed. TBC if anything does not work as expected (I'd assume images would definitely not 9868 work, likely some of the added cache functionality, etc.) still was helpful to get static assets chunks (css/js/fonts) resolving instead of 404ing #!/bin/sh
set -e # Exit on any error
# Configuration
BASE_PATH_DIR="basepath"
SOURCE_DIR=".open-next/assets"
DEST_DIR="${SOURCE_DIR}/${BASE_PATH_DIR}"
# Create destination directory
mkdir -p "${DEST_DIR}" || { echo "Failed to create destination directory"; exit 1; }
# Move all contents (including hidden files) to the destination
mv "${SOURCE_DIR}"/* "${SOURCE_DIR}"/.??* "${DEST_DIR}/" 2>/dev/null || true
echo "┌────────────────────────────────────────────────────────────────────────────┐"
echo "│ [patch] basePath patched: /assets/ moved successfully to /assets/basePath/ │"
echo "└────────────────────────────────────────────────────────────────────────────┘" (run you can then edit your build/deploy scripts so this always run after |
When using a
basePath
:Static assets and images are not handled correctly:
The text was updated successfully, but these errors were encountered: