diff --git a/frontend/apps/video-info-website/_redirects b/frontend/apps/video-info-website/_redirects new file mode 100644 index 0000000000..322aa37c8e --- /dev/null +++ b/frontend/apps/video-info-website/_redirects @@ -0,0 +1,2 @@ +# SPA fallback: serve index.html for any path so deep links / refreshes work. +/* /index.html 200 diff --git a/frontend/apps/video-info-website/netlify.toml b/frontend/apps/video-info-website/netlify.toml new file mode 100644 index 0000000000..64d808f05a --- /dev/null +++ b/frontend/apps/video-info-website/netlify.toml @@ -0,0 +1,16 @@ +# Netlify config for the video-info-website (Nx + Vite SPA). +# +# All paths are relative to the site's **base directory**, which must be set to +# `frontend` in the Netlify UI (Site config → Build & deploy → Base directory). +# That's the Nx workspace root, so `npx nx` and node_modules resolve correctly. + +[build] +command = "./apps/video-info-website/script/netlify_build.sh" +publish = "apps/video-info-website/dist/" + +# Vite emits content-hashed files under dist/assets — safe to cache forever. +[[headers]] +for = "/assets/*" + +[headers.values] +"Cache-Control" = "public, max-age=31536000, immutable" diff --git a/frontend/apps/video-info-website/script/netlify_build.sh b/frontend/apps/video-info-website/script/netlify_build.sh new file mode 100755 index 0000000000..9e86c62047 --- /dev/null +++ b/frontend/apps/video-info-website/script/netlify_build.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -euxo pipefail + +# Runs from the Netlify base directory (= the Nx workspace root, `frontend/`). + +echo "Building video-info-website" +npx nx build @frontend/video-info-website + +echo "Copy netlify configs into dist" +pushd apps/video-info-website/ +cp _redirects dist/ +popd + +echo "Final build files:" +find apps/video-info-website/dist/